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

CompilationDatabaseProjectManager: Clang Code Model lost "BuiltIn" header paths, stdlib headers can't be found [4.9 beta1 regression]

    XMLWordPrintable

Details

    • Linux/X11

    Description

      Loading a compile_commands.json / CompilationDatabaseProjectManager project in 4.9-beta1 (2857, or current git master) lacks the system paths provided by the compiler, meaning STL headers like vector won't be found.

      Loading that project in 4.8.1 works, and loading a simple GenericProject with 4.9-beta1 also works, i.e. it has the corrects paths.

      To reproduce with test.cpp and these two project types:

      echo '#include <vector>' > test.cpp
      clang++ -c test.cpp -o test.o -MJ test.json -I/includepath -isystem/includepath2
      { echo '['; cat test.json; echo ']'; } > compile_commands.json
      
      touch gp.creator gp.includes gp.config 
      echo test.cpp > gp.files
      

      Tools -> C++ -> Inspect C++ Code Model (or Ctrl-Shift-F12) -> "Header Paths" Tab shows that only includepath and includepath2 are present when the compile_commands.json is loaded.

      Attachments

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

        Activity

          People

            kosjar Nikolai Kosjar
            tmmz Thomas Otto
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes