[clang] a8a6b66 - [clang] Document -Wglobal-constructors behavior (#68084)

via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 26 14:09:35 PDT 2023


Author: serge-sans-paille
Date: 2023-10-26T21:09:31Z
New Revision: a8a6b66a266e8917caa4e9fb1371c24bd54c32b3

URL: https://github.com/llvm/llvm-project/commit/a8a6b66a266e8917caa4e9fb1371c24bd54c32b3
DIFF: https://github.com/llvm/llvm-project/commit/a8a6b66a266e8917caa4e9fb1371c24bd54c32b3.diff

LOG: [clang] Document -Wglobal-constructors behavior (#68084)

It's a drop in the ocean considering the lack of documentation of our
diagnostics, but it's a start.

Co-authored-by: serge-sans-paille <sguelton at mozilla.com>

Added: 
    

Modified: 
    clang/include/clang/Basic/DiagnosticGroups.td

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td
index 318eb0d6f889065..9a8f3f03b39d165 100644
--- a/clang/include/clang/Basic/DiagnosticGroups.td
+++ b/clang/include/clang/Basic/DiagnosticGroups.td
@@ -415,7 +415,11 @@ def : DiagGroup<"c++2a-compat-pedantic", [CXX20CompatPedantic]>;
 def ExitTimeDestructors : DiagGroup<"exit-time-destructors">;
 def FlexibleArrayExtensions : DiagGroup<"flexible-array-extensions">;
 def FourByteMultiChar : DiagGroup<"four-char-constants">;
-def GlobalConstructors : DiagGroup<"global-constructors">;
+def GlobalConstructors : DiagGroup<"global-constructors"> {
+ code Documentation = [{
+Emit a warning for each variable declaration that generates code run at startup.
+ }];
+}
 def BitwiseConditionalParentheses: DiagGroup<"bitwise-conditional-parentheses">;
 def BitwiseOpParentheses: DiagGroup<"bitwise-op-parentheses">;
 def LogicalOpParentheses: DiagGroup<"logical-op-parentheses">;


        


More information about the cfe-commits mailing list