https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64644
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |manu at gcc dot gnu.org --- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> --- A untested patch, feel free to test it and submit it. Index: decl2.c =================================================================== --- decl2.c (revision 218749) +++ decl2.c (working copy) @@ -1604,11 +1604,11 @@ finish_anon_union (tree anon_union_decl) main_decl = build_anon_union_vars (type, anon_union_decl); if (main_decl == error_mark_node) return; if (main_decl == NULL_TREE) { - warning (0, "anonymous union with no members"); + pedwarn (input_location, 0, "anonymous union with no members"); return; } if (!processing_template_decl) {