[clang] [clang][diagnostics] add '-Wundef-true' warning option (PR #128265)

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 1 14:49:27 PST 2025


================
@@ -791,6 +791,8 @@ def ReservedIdAsMacroAlias : DiagGroup<"reserved-id-macro", [ReservedIdAsMacro]>
 def ReservedAttributeIdentifier : DiagGroup<"reserved-attribute-identifier">;
 def RestrictExpansionMacro : DiagGroup<"restrict-expansion">;
 def FinalMacro : DiagGroup<"final-macro">;
+def UndefinedIdentifier : DiagGroup<"undef">;
+def UndefinedTrueIdentifier : DiagGroup<"undef-true", [UndefinedIdentifier]>;
----------------
zygoloid wrote:

This looks reversed to me: I think we want `UndefinedTrueIdentifier` to be listed as a child of `UndefinedIdentifier`, not the other way around, so that (eg) `-Wundef` implies `-Wundef-true` (not vice versa).

https://github.com/llvm/llvm-project/pull/128265


More information about the cfe-commits mailing list