| Issue |
177170
|
| Summary |
clang-scan-deps fails to parse C++ files when comparing a macro against a numeric literal that contains digit separators in preprocessor.
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
pure-purpose
|
clang version 21.1.8
Target: x86_64-w64-windows-gnu
Thread model: posix
```cpp
#if __cplusplus >= 2020'00L
#endif
int main(int argc, char *argv[])
{
return 0;
}
```
clang-scan-deps fails with such error
`test.cpp:1:24: error: token is not a valid binary operator in a preprocessor subexpression`
Accroding to CMake policy [CMP0155](https://cmake.org/cmake/help/latest/policy/CMP0155.html)
> CMake 3.27 and below assume that C++ sources do not import modules. CMake 3.28 and above prefer to assume that C++ sources in targets using C++20 or higher might import modules, and must be scanned before compiling, unless explicitly disabled.
clang-scan-deps is always invoked with CMake 3.28+ and C++20 or higher, even if I am not utilizing C++ module features. (I encounter the bug in NIVADIA/stdexec library where there are many feature testing macros used with numeric literals which contain digit separators.)
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs