[PATCH] D80751: [clang][diagnostics] Add '-Wundef-prefix' warning option

Zixu Wang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 8 16:39:49 PDT 2020


zixuw added inline comments.


================
Comment at: clang/include/clang/Basic/DiagnosticGroups.td:108
+def Undefined : DiagGroup<"undef">;
+def UndefinedPrefix : DiagGroup<"undef-prefix", [Undefined]>;
 def UnsupportedNan : DiagGroup<"unsupported-nan">;
----------------
arphaman wrote:
> It seems like you're not using the `UndefinedPrefix` group in this patch. Is that intentional, or was this left in the patch by mistake?
This is intentional to map both `Wundef` and `Wundef-prefix` to the same warning. And since `Wundef` is changed to an alias, the `Undefined` subgroup is used to keep existing outputs/behaviors consistent (to make `-Werror=undef` work, and to keep the `[-Wundef]` option name in the diagnostic message).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80751/new/

https://reviews.llvm.org/D80751





More information about the cfe-commits mailing list