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

Incorrect Error Highlighting in Qt Creator / Non-qt projects

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • Qt Creator 2.8.1
    • C/C++/Obj-C++ Support
    • None
    • Ubuntu Linux / GCC 4.7.3
      Windows / MinGW / GCC 4.8.1

      We recently transitioned an old code base to use Qt Creator and qmake. The old code base included a "foreach" macro, which performed a similar function to Qt's foreach loop.

      Our projects don't use the Qt framework, so we always use CONFIG-=qt in project files. This means that there are no issues with Qt's foreach when building.

      However, when viewing code in Qt Creator, the usage of foreach is highlighted in red as an error, even when the code builds successfully. Renaming our 'foreach' macro to something else fixes the problem.

      I've attached a simple test case which should demonstrate the issue.

        1. foreach.h
          6 kB
          Reid Watson
        2. test.cc
          0.2 kB
          Reid Watson
        3. test.pro
          0.3 kB
          Reid Watson
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            kosjar Nikolai Kosjar
            rawatson Reid Watson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes