From 9d8da7e0221ec408db68d84f3edd4aec58883eb1 Mon Sep 17 00:00:00 2001 From: serge-sans-paille Date: Tue, 3 Oct 2023 10:54:14 +0200 Subject: [PATCH] [clang] Document -Wglobal-constructors behavior It's a drop in the ocean considering the lack of documentation of our diagnostics, but it's a start. --- clang/include/clang/Basic/DiagnosticGroups.td | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td index 0b09c00219184..55e15e68764c4 100644 --- a/clang/include/clang/Basic/DiagnosticGroups.td +++ b/clang/include/clang/Basic/DiagnosticGroups.td @@ -416,7 +416,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">;