Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Clang Code Model - QtCreator 4.6.1 vs 4.7.0

Clang Code Model - QtCreator 4.6.1 vs 4.7.0

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
6 Posts 2 Posters 3.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    PbvS
    wrote on last edited by
    #1

    Hey all,

    Upgraded yesterday from QtCreator 4.6.1 to 4.7.0 (running on Debian 8). I noticed some things which I would like to discuss and see if there is something wrong on my system/project/setup or it would be a bug in QtCreator itself.

    To note; I have used the same source files and cmake configuration in both versions, so there is no difference in the input. Project also builds fine, so the errors/warnings do not have any impact there.

    1. This code model could not parse an included file
      When opening an .cpp file I get a warning on top of the file saying 'The code model could not parse an included file, which might lead to incorrect code completetion and highlighting'. Warning is on the file 'c++0x_warning.h'; however in the previous version of QtCreator I didn't have this warning.

    2. no template named 'shared_ptr' in namespace 'std'
      The warning on top of the file is the same 'the code model could not parse...', however this time in a header file it shows the message 'error: no template named 'shared_ptr' in namespace 'std''. This warning is coming from an included file lower in the source tree. If I open that file, the warning is gone and I can click on the shared_ptr to end up in the shared_ptr class. So, it seems to have problems resolving includes in headers, which include other headers, and so on?

    Questions, remarks, feedback are welcome.

    Thanks

    aha_1980A 1 Reply Last reply
    1
    • P PbvS

      Hey all,

      Upgraded yesterday from QtCreator 4.6.1 to 4.7.0 (running on Debian 8). I noticed some things which I would like to discuss and see if there is something wrong on my system/project/setup or it would be a bug in QtCreator itself.

      To note; I have used the same source files and cmake configuration in both versions, so there is no difference in the input. Project also builds fine, so the errors/warnings do not have any impact there.

      1. This code model could not parse an included file
        When opening an .cpp file I get a warning on top of the file saying 'The code model could not parse an included file, which might lead to incorrect code completetion and highlighting'. Warning is on the file 'c++0x_warning.h'; however in the previous version of QtCreator I didn't have this warning.

      2. no template named 'shared_ptr' in namespace 'std'
        The warning on top of the file is the same 'the code model could not parse...', however this time in a header file it shows the message 'error: no template named 'shared_ptr' in namespace 'std''. This warning is coming from an included file lower in the source tree. If I open that file, the warning is gone and I can click on the shared_ptr to end up in the shared_ptr class. So, it seems to have problems resolving includes in headers, which include other headers, and so on?

      Questions, remarks, feedback are welcome.

      Thanks

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by aha_1980
      #2

      hi @PbvS,

      did you upgrade with the Qt MaintenanceTool? I.e. are you using a precompiled Creator from qt.io?

      The precompiled package ships a new version of libclang with C++17 support.

      So it may be, the compiler flags are not correctly passed to libclang.

      Which C++ standard does your code use?

      Regards

      Qt has to stay free or it will die.

      P 1 Reply Last reply
      0
      • aha_1980A aha_1980

        hi @PbvS,

        did you upgrade with the Qt MaintenanceTool? I.e. are you using a precompiled Creator from qt.io?

        The precompiled package ships a new version of libclang with C++17 support.

        So it may be, the compiler flags are not correctly passed to libclang.

        Which C++ standard does your code use?

        Regards

        P Offline
        P Offline
        PbvS
        wrote on last edited by
        #3

        Hey @aha_1980 ,

        Thanks for you're reply! I did download QtCreator and used the .run file to install, so precompiled.

        I'm using C++14.

        Is there some way I could get more information? I have already used the flags to get more info from the clangbackend, but it only shows the errors I also see in the screen (no additional files not found, or whatever).

        aha_1980A 1 Reply Last reply
        0
        • P PbvS

          Hey @aha_1980 ,

          Thanks for you're reply! I did download QtCreator and used the .run file to install, so precompiled.

          I'm using C++14.

          Is there some way I could get more information? I have already used the flags to get more info from the clangbackend, but it only shows the errors I also see in the screen (no additional files not found, or whatever).

          aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi @PbvS,

          I'm using C++14.

          Ok, which project manager do you use? QMake? Then do you have CONFIG+=c++14 in your .pro file?

          Is there some way I could get more information?

          You could try the debugging steps mentioned in https://wiki.qt.io/Qt_Creator_Clang_Code_Model

          Maybe this gives some new insight...

          Qt has to stay free or it will die.

          P 1 Reply Last reply
          0
          • aha_1980A aha_1980

            Hi @PbvS,

            I'm using C++14.

            Ok, which project manager do you use? QMake? Then do you have CONFIG+=c++14 in your .pro file?

            Is there some way I could get more information?

            You could try the debugging steps mentioned in https://wiki.qt.io/Qt_Creator_Clang_Code_Model

            Maybe this gives some new insight...

            P Offline
            P Offline
            PbvS
            wrote on last edited by
            #5

            @aha_1980 I'm using cmake. Tried using add_definitions("-std=c++14") as well as set(CMAKE_CXX_FLAGS "-std=c++14"). Found on the internet also another approach using add_compile_options(-std=c++14) but also no luck.

            By the way still on cmake 3.0.2.

            I have tried the debugging, didn't see any helpfull information. Will try again and post it later here.

            aha_1980A 1 Reply Last reply
            0
            • P PbvS

              @aha_1980 I'm using cmake. Tried using add_definitions("-std=c++14") as well as set(CMAKE_CXX_FLAGS "-std=c++14"). Found on the internet also another approach using add_compile_options(-std=c++14) but also no luck.

              By the way still on cmake 3.0.2.

              I have tried the debugging, didn't see any helpfull information. Will try again and post it later here.

              aha_1980A Offline
              aha_1980A Offline
              aha_1980
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @PbvS said in Clang Code Model - QtCreator 4.6.1 vs 4.7.0:

              I'm using cmake.

              Ok, I'm out here...

              Tried using add_definitions("-std=c++14") as well as set(CMAKE_CXX_FLAGS "-std=c++14"). Found on the internet also another approach using add_compile_options(-std=c++14) but also no luck.

              The flags needs to be passed to the Code Model - no idea how this works for Cmake.

              You might also ask this question on the Creator mailing list...

              Regards

              Qt has to stay free or it will die.

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved