-
- Downloads
[clang] Introduce support for disabling warnings in system macros
Often we run into situations where we want to ignore warnings from system headers, but Clang will still give warnings about the contents of a macro defined in a system header used in user-code. Introduce a ShowInSystemMacro option to be able to specify which warnings we do want to keep raising warnings for. The current behavior is kept in this patch (i.e. warnings from system macros are enabled by default). The decision as to whether this should be an opt-in or opt-out feature can be made in a separate patch. To put the feature to test, replace duplicated code for Wshadow and Wold-style-cast with the SuppressInSystemMacro tag. Also disable the warning for C++20 designators, fixing #52944. Differential Revision: https://reviews.llvm.org/D116833
Showing
- clang-tools-extra/clangd/Diagnostics.cpp 1 addition, 1 deletionclang-tools-extra/clangd/Diagnostics.cpp
- clang/include/clang/Basic/Diagnostic.td 9 additions, 1 deletionclang/include/clang/Basic/Diagnostic.td
- clang/include/clang/Basic/DiagnosticAST.h 1 addition, 1 deletionclang/include/clang/Basic/DiagnosticAST.h
- clang/include/clang/Basic/DiagnosticAnalysis.h 1 addition, 1 deletionclang/include/clang/Basic/DiagnosticAnalysis.h
- clang/include/clang/Basic/DiagnosticComment.h 1 addition, 1 deletionclang/include/clang/Basic/DiagnosticComment.h
- clang/include/clang/Basic/DiagnosticCrossTU.h 1 addition, 1 deletionclang/include/clang/Basic/DiagnosticCrossTU.h
- clang/include/clang/Basic/DiagnosticDriver.h 1 addition, 1 deletionclang/include/clang/Basic/DiagnosticDriver.h
- clang/include/clang/Basic/DiagnosticFrontend.h 1 addition, 1 deletionclang/include/clang/Basic/DiagnosticFrontend.h
- clang/include/clang/Basic/DiagnosticIDs.h 1 addition, 1 deletionclang/include/clang/Basic/DiagnosticIDs.h
- clang/include/clang/Basic/DiagnosticLex.h 1 addition, 1 deletionclang/include/clang/Basic/DiagnosticLex.h
- clang/include/clang/Basic/DiagnosticParse.h 1 addition, 1 deletionclang/include/clang/Basic/DiagnosticParse.h
- clang/include/clang/Basic/DiagnosticRefactoring.h 1 addition, 1 deletionclang/include/clang/Basic/DiagnosticRefactoring.h
- clang/include/clang/Basic/DiagnosticSema.h 1 addition, 1 deletionclang/include/clang/Basic/DiagnosticSema.h
- clang/include/clang/Basic/DiagnosticSemaKinds.td 5 additions, 3 deletionsclang/include/clang/Basic/DiagnosticSemaKinds.td
- clang/include/clang/Basic/DiagnosticSerialization.h 1 addition, 1 deletionclang/include/clang/Basic/DiagnosticSerialization.h
- clang/lib/Basic/DiagnosticIDs.cpp 13 additions, 4 deletionsclang/lib/Basic/DiagnosticIDs.cpp
- clang/lib/Sema/SemaDecl.cpp 0 additions, 2 deletionsclang/lib/Sema/SemaDecl.cpp
- clang/lib/Sema/SemaExpr.cpp 1 addition, 2 deletionsclang/lib/Sema/SemaExpr.cpp
- clang/test/SemaCXX/warn-sysheader-macro.cpp 12 additions, 2 deletionsclang/test/SemaCXX/warn-sysheader-macro.cpp
- clang/test/TableGen/DiagnosticBase.inc 9 additions, 0 deletionsclang/test/TableGen/DiagnosticBase.inc
Please register or sign in to comment