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

QTEST_APPLESS_MAIN macro false positive error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • Qt Creator 4.9.0
    • C/C++/Obj-C++ Support
    • None
    • Qt Creator 4.9.0
    • Windows

    Description

      I created a new Auto Test project and the generated source.cpp file contained the macro:  QTEST_APPLESS_MAIN(ClassName), with the following error:

      tst_myclass.cpp:33:1: error: cannot initialize a parameter of type 'const char *' with an rvalue of type 'int'
      qtest.h:402:5: note: expanded from macro 'QTEST_APPLESS_MAIN'
      qtest.h:372:74: note: expanded from macro 'QTEST_SET_MAIN_SOURCE_PATH'
      9:30: note: expanded from here
      qtestcase.h:303:75: note: passing argument to parameter 'builddir' here

      However, the project compiled and ran normally.

      Attachments

        1. example_project.7z
          4 kB
        2. False error QTEST_APPLESS_MAIN_v4.14.png
          False error QTEST_APPLESS_MAIN_v4.14.png
          64 kB
        3. False error QTEST_APPLESS_MAIN.png
          False error QTEST_APPLESS_MAIN.png
          66 kB
        4. Kits and MinGW version.png
          Kits and MinGW version.png
          41 kB
        5. screenshot-1.png
          screenshot-1.png
          97 kB
        6. screenshot-2.png
          screenshot-2.png
          24 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kosjar Nikolai Kosjar
            gabriel-22 Gabriel Andolphatto
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes