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

Clang code model: __LINE__ macro has the same value in every line

    XMLWordPrintable

    Details

      Description

      It seems like the clang code model uses the same value for the _LINE_ macro in every line of a source file (in my case 85). This leads to errors, e.g. if _LINE_ is sued to create a local variable in a macro like in the following constructed example:

       

      #define FOO2(l) int x ## l = 0;
       #define FOO(l) FOO2(l)
      int main(){
           FOO(_LINE_);
           FOO(_LINE_);
       }
      

       

      A clang warning is printed in the editor "redefinition of 'x85'" for the second FOO(_LINE_)-line.

        Attachments

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

          Activity

            People

            • Assignee:
              yvvan Ivan Donchevskii
              Reporter:
              jvehlow jvehlow
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes