Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-21623

Clang uses wrong encoding for header file not open in editor

    XMLWordPrintable

Details

    Description

      If open the source with Creator, analysis of the file fails, and there are cases where there are errors on the editor.
       
      Condition: 

      • Use Clang Code Model
      • Shift_JIS character which latter byte is 0x5c in end of comment in header file such as 能, 表
      • There must be some C++ code or character in following of above line
      • Not open that include file on editor
      • Open file which includes above. (main.cpp in sample)

       
      Creator won't recognize character code (Shift_JIS in this case) when analyze if the file is not open.
       
      If end of comment byte is 0x5c, Creator may recognize as '\' (back slash) thus concatenates with next line.
       
      Initially, Clang should not support Shift-JIS, but when opening a file with Creator, it seems that it is analyzed without problem whether it converts to UTF - 8 and passes it.
       
      In connection with this, if execute Analysis by Clang with Analyze → Clang-Tidy and Clazy on Creator, it fails. This is more serious and Japanese in the string literal becomes an error.

      Attachments

        1. QTCREATORBUG-21623.zip
          2 kB
        2. NoError.png
          NoError.png
          32 kB
        3. Error.png
          Error.png
          37 kB

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              kosjar Nikolai Kosjar
              akizawa Akihito Izawa
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes