Issue 131466
Summary clang-tidy.cert-dcl58-cpp false positive
Labels
Assignees
Reporter ursoft
    When I use `CMAKE_CXX_FLAGS=--gcc-install-dir=/usr/lib/gcc/x86_64-linux-gnu/13`, no clang-tidy issues found.
But with `CMAKE_CXX_FLAGS=--gcc-install-dir=/usr/lib/gcc/x86_64-linux-gnu/14` i get:
```
FAILED: CMakeFiles/pso_metr.dir/lib/metrology/pso_metr.cpp.o 
/usr/bin/cmake -E __run_co_compile --tidy="/usr/bin/clang-tidy-20;--warnings-as-errors=*;--config-file=tidycfg.yaml;--extra-arg-before=--driver-mode=g++" --source=test.cpp -- /usr/bin/clang++-20 -DONLY_C_LOCALE=0 -DUSE_OS_TZDB=1 --gcc-install-dir=/usr/lib/gcc/x86_64-linux-gnu/14 -O3 -DNDEBUG -gline-tables-only -std=gnu++20 -fPIC -Wall -Wextra -Werror -Wno-unknown-pragmas -Wno-unknown-warning-option -Wno-unknown-attributes -Wno-unknown-sanitizers -ftabstop=4 -ferror-limit=100 -Winvalid-pch -Xclang -include-pch -Xclang cmake_pch.hxx.pch -Xclang -include -Xclang cmake_pch.hxx -MD -MT test.cpp.o -MF test.cpp.o.d -o test.cpp.o -c test.cpp
error: modification of 'std' namespace can result in undefined behavior [cert-dcl58-cpp,-warnings-as-errors]
/usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/type_traits:65:11: note: 'std' namespace opened here
   65 | namespace std _GLIBCXX_VISIBILITY(default)
      |           ^
```
I suppose there is something wrong with "is system header" check - 14th folder by some reason is not "system".
tidycfg.yaml contains:
```
HeaderFilterRegex: '(/cxxpr/.+\.hxx$)|((Opc|[^bk]/core/|/drivers/).+\.(h|hpp|hxx)$)'
SystemHeaders: false
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to