I have been having trouble getting clang-tidy to work on my local computer. My code is filled with these three errors:
error: declaration must be declared within the '__llvm_libc' namespace [llvmlibc-implementation-in-namespace,-warnings-as-errors]
error: 'connect2AtLevel' must resolve to a function declared within the '__llvm_libc' namespace [llvmlibc-callee-namespace,-warnings-as-errors]
error: system include cassert not allowed [llvmlibc-restrict-system-libc-headers,-warnings-as-errors]
I read the explanations of these errors and I still don't understand what I need to do. It seems to be something to do with what headers are available in llvm? I normally use libstdc++ that is included with gcc, do I need to use the llvm library instead? If for instance I wanted to use cassert, what would that look like to get these errors to go away? I would rather not just add something to my .clang-tidy if I can fix this.
EDIT: Here is the additional information requested.
Program versions:
GCC 11.1.0: libstdc++.so.6.0.29
LLVM version 13.0.0
clang-tidy is run with:
clang-tidy *.cpp -std=c++11
And here is the contents of .clang-tidy
: (this file was given using an older version of LLVM, what should be done to update the HeaderFilterRegex
?):
WarningsAsErrors: '*'
HeaderFilterRegex: '.*'
CheckOptions:
{ key: readability-identifier-naming.ClassCase, value: CamelCase }
{ key: readability-identifier-naming.StructCase, value: CamelCase }
{ key: readability-identifier-naming.EnumCase, value: CamelCase }
{ key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE }
{ key: readability-identifier-naming.VariableCase, value: camelBack }
{ key: readability-identifier-naming.ParameterCase, value: camelBack }
{ key: readability-identifier-naming.PublicMemberCase, value: camelBack }