| Issue |
178284
|
| Summary |
Clang-Tidy doesn't define __clang_analyzer__ when run by clangd
|
| Labels |
clang-tidy
|
| Assignees |
|
| Reporter |
roubert
|
Clang-Tidy defines the `__clang_analyzer__` macro to make it possible for the preprocessor to detect when the code is being analyzed:
https://reviews.llvm.org/D46325
https://reviews.llvm.org/D68093
https://github.com/llvm/llvm-project/blob/llvmorg-21.1.8/clang-tools-extra/clang-tidy/ClangTidy.cpp#L591
This works as expected when running the `clang-tidy` tool from the commandline, but as far as I can see, it doesn't work when run by clangd.
I guess clangd doesn't go through the initialization in `ClangTidy.cpp` but instead does its own thing when running the analyzers and there doesn't do the `SetUpStaticAnalyzer = true` that ClangTidy.cpp does to get `__clang_analyzer__` defined. I assume that this is a bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs