Different behavior with clang-tidy: open local folder with CMakeLists vs. VS sln file generated by cmake
See original GitHub issueTrying to understand some different behavior running clang-tidy through clang-power-tools on Visual Studio 2022 Community Ed. Running clang-tidy is started by clicking the Tidy icon from the Clang Power Tools.
Quick summary: can’t get clang-tidy to run through VS 2022 when local folder (with CMakeLists.txt) is opened. Works with CMake generated VS Soln file opened with VS 2022.
More details below: Opening the local folder of a very simple CMake project with VS 2022 Comm Ed and attempting to run clang-tidy, selecting the Tidy button, I get the following in the Output tab:
--- CLANG TIDY STARTED ---
At line:1 char:132
+ ... \EXTENSIONS\vfkd2wds.v0j\Tooling\\v1\clang-build.ps1' -proj ) -file ( ...
+ ~
Unexpected token ')' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken
--- CLANG TIDY FINISHED ---
and clang-tidy does not run as I would expect.
However, if I use cmake to generate the VS Solution file and open the solution into VS 2022 Comm Ed, clang-tidy runs as I would expect. cmake -G “Visual Studio 17 2022” … In this case, the beginning of the output looks like this:
--- CLANG TIDY STARTED ---
VERBOSE: Current Clang Power Tools VSIX version: 9.1.0.1424
VERBOSE: Loaded assembly C:\Program Files\Microsoft Visual
Studio\2022\Community\MSBuild\Current\Bin\Microsoft.Build.Utilities.Core.dll
VERBOSE: clang-build.ps1 invocation args:
....
Not sure what may be causing this different behavior. I’m using
clang power tools version 9.1.0.1424 Visual Studio 2022 Comm Ed Version 17.3.3
the code I’ve been testing this with is very simple: https://github.com/willemsn/clangTestCase
Any thoughts on what may be causing this behavior or if I’m doing something that might be causing this?
Issue Analytics
- State:
- Created a year ago
- Comments:8 (5 by maintainers)
Top GitHub Comments
Hi @mariru27, I can confirm that the fix solves the issue for me.
Hi,
A release with bugfix for this issue is available in new v2023.2.1 of Clang Power Tools
Thank you for your help
Have a nice day, Marina