Skip to content

Header-only fallback incorrectly occurs when system headers are opened using compileCommands #5508

@sean-mcmanus

Description

@sean-mcmanus

Use test.cpp

#include <string> int main() { std::string s; } 

with some compile_commands.json like

[ { "directory": "<dir>", "command": "C:\\PROGRA~2\\MICROS~3\\2017\\ENTERP~1\\VC\\Tools\\MSVC\\1416~1.270\\bin\\Hostx86\\x86\\cl.exe -c sub.cpp", "file": "sub.cpp" } ] 

Then use Go to Definition on std::string.

Bug: The TU for xstring gets opened as a header only fallback instead of using the existing TU for sub.cpp.

This bug doesn't repro when using the CMake Tools configurationProvider.

Bug2 in #5506 is related.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions