-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Language ServicebugfixedCheck the Milestone for the release in which the fix is or will be available.Check the Milestone for the release in which the fix is or will be available.
Milestone
Description
Brief Issue Summary
Either cmake-tools or cpptools (I'm not quite sure) apparently aren't correctly probing clang on my system, resulting in broken IntelliSense. This only applies if I use precompiled headers in my project. gcc works as expected with precompiled headers.
Expected:
cmake-tools use my compiler (Kit) configuration and build system information to provide IntelliSense.
Apparent Behavior:
The C++ log in VSCode shows:
Compiler probe command line: "/usr/bin/clang++-10" -fsanitize=undefined -fsanitize=address -g -fPIC -fvisibility=hidden -Wall -Wextra -Wunused -Wignored-qualifiers -Wmissing-braces -Wreturn-type -Wswitch -Wswitch-default -Wuninitialized -Wmissing-field-initializers -Wcast-align -Wmissing-declarations -Wpedantic -Wreorder -Wreturn-stack-address -std=c++17 -Xclang -Xclang /path/to/build/Debug/source/main/CMakeFiles/main.dir/cmake_pch.hxx.pch -Xclang /path/to/build/Debug/source/main/CMakeFiles/main.dir/cmake_pch.hxx -Wp,-v -E -dD -x c++ -m64 -fno-blocks /dev/null
Done discovering files.
Populate include completion cache.
Discovering files...
Processing folder (recursive): /usr/local/include/
Processing folder (recursive): /usr/lib64/clang/10.0.1/include/
Failed to query compiler. Falling back to 32-bit intelliSenseMode.
Compiler probe command line: "/usr/bin/clang++-10" -fsanitize=undefined -fsanitize=address -g -fPIC -fvisibility=hidden -Wall -Wextra -Wunused -Wignored-qualifiers -Wmissing-braces -Wreturn-type -Wswitch -Wswitch-default -Wuninitialized -Wmissing-field-initializers -Wcast-align -Wmissing-declarations -Wpedantic -Wreorder -Wreturn-stack-address -std=c++17 -Xclang -Xclang /path/to/build/Debug/source/main/CMakeFiles/main.dir/cmake_pch.hxx.pch -Xclang /path/to/build/Debug/source/main/CMakeFiles/main.dir/cmake_pch.hxx -Wp,-v -E -dD -x c++ -m32 -fno-blocks /dev/null
Processing folder (recursive): /usr/include/
Failed to query compiler. Falling back to no bitness.
Compiler probe command line: "/usr/bin/clang++-10" -fsanitize=undefined -fsanitize=address -g -fPIC -fvisibility=hidden -Wall -Wextra -Wunused -Wignored-qualifiers -Wmissing-braces -Wreturn-type -Wswitch -Wswitch-default -Wuninitialized -Wmissing-field-initializers -Wcast-align -Wmissing-declarations -Wpedantic -Wreorder -Wreturn-stack-address -std=c++17 -Xclang -Xclang /path/to/build/Debug/source/main/CMakeFiles/main.dir/cmake_pch.hxx.pch -Xclang /path/to/build/Debug/source/main/CMakeFiles/main.dir/cmake_pch.hxx -Wp,-v -E -dD -x c++ -fno-blocks /dev/null
clang-10: warning: /path/to/build/Debug/source/main/CMakeFiles/main.dir/cmake_pch.hxx.pch: previously preprocessed input [-Wunused-command-line-argument]
error: unknown argument: '-Xclang'
The main issue here seems to be "-Xclang" twice in sequence, which is incorrect. I'm not sure where it comes from. The compile commands typically have -Xclang -include -Xclang /path/to/something.pch to include precompiled headers, so maybe VSCode is doing some strange postprocessing on the compiler flags.
Platform and Versions
- Operating System: Fedora 32
- CMake Version: 3.17.4
- VSCode Version: 1.50.1
- CMake Tools Extension Version: 1.4.2 (cpptools: 1.1.0-insiders2, but same behavior with stable version)
- Compiler/Toolchain: clang 10.0.1
Metadata
Metadata
Assignees
Labels
Language ServicebugfixedCheck the Milestone for the release in which the fix is or will be available.Check the Milestone for the release in which the fix is or will be available.