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

Clang: Problems with declspec(...) behind a macro

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • Qt Creator 4.5.0
    • C/C++/Obj-C++ Support
    • None
    • Windows 10 (latest update as of 7/12/2017)
      MSVC 2017 15.5

    Description

      The exporting/importing macros like the ones generated by the plugin template:

      #if defined(LIB)
      # define SHARED Q_DECL_EXPORT
      #else
      # define SHARED Q_DECL_IMPORT
      #endif
      

      confuses the Clang Static Analyzer as it does not recognize the actual value in the define. At first I suspected using VS 15.5 might be an issue however even when changing it to declspec(...) it still did not work when in another file. Also tried setting various language versions to no avail. Tried both Qbs and Qmake and both suffers from the same issue. It of course compiles fine and correct linkage is used.

      When placed directly into the file where it was used it worked fine.

      Another related quirk is that when first opening the file the analyzer does not detect any issues. However as soon as a change is made it starts showing the above as a problem even if the change was simply adding an empty line at the end of a file.

      Attachments

        Issue Links

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

          Activity

            People

              yvvan Ivan Donchevskii
              resurr3ction Michael Vlach
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes