[all-commits] [llvm/llvm-project] c4db52: [clang] Introduce support for disabling warnings i...

Carlos Galvez via All-commits all-commits at lists.llvm.org
Wed Jan 12 00:18:43 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c4db521cea32fcfb714d1a622e0efce69a564a28
      https://github.com/llvm/llvm-project/commit/c4db521cea32fcfb714d1a622e0efce69a564a28
  Author: Carlos Galvez <carlosgalvezp at gmail.com>
  Date:   2022-01-12 (Wed, 12 Jan 2022)

  Changed paths:
    M clang-tools-extra/clangd/Diagnostics.cpp
    M clang/include/clang/Basic/Diagnostic.td
    M clang/include/clang/Basic/DiagnosticAST.h
    M clang/include/clang/Basic/DiagnosticAnalysis.h
    M clang/include/clang/Basic/DiagnosticComment.h
    M clang/include/clang/Basic/DiagnosticCrossTU.h
    M clang/include/clang/Basic/DiagnosticDriver.h
    M clang/include/clang/Basic/DiagnosticFrontend.h
    M clang/include/clang/Basic/DiagnosticIDs.h
    M clang/include/clang/Basic/DiagnosticLex.h
    M clang/include/clang/Basic/DiagnosticParse.h
    M clang/include/clang/Basic/DiagnosticRefactoring.h
    M clang/include/clang/Basic/DiagnosticSema.h
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Basic/DiagnosticSerialization.h
    M clang/lib/Basic/DiagnosticIDs.cpp
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaExpr.cpp
    M clang/test/SemaCXX/warn-sysheader-macro.cpp
    M clang/test/TableGen/DiagnosticBase.inc
    M clang/test/TableGen/deferred-diag.td
    M clang/tools/diagtool/DiagnosticNames.cpp
    M clang/utils/TableGen/ClangDiagnosticsEmitter.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list