On 6/8/23 07:06, Alex Coplan wrote:
Hi,

macOS SDK headers using the CF_ENUM macro can expand to invalid C++ code
of the form:

typedef enum T : BaseType T;

i.e. an elaborated-type-specifier with an additional enum-base.
Upstream LLVM can be made to accept the above construct with
-Wno-error=elaborated-enum-base.

I guess we might as well follow that example, and so instead of this check:

+          || (underlying_type && !in_system_header_at (colon_loc)))

Make the below an on-by-default pedwarn using OPT_Welaborated_enum_base, and don't return error_mark_node.

+             cp_parser_commit_to_tentative_parse (parser);
+             error_at (colon_loc,
+                       "declaration of enumeration with "
+                       "fixed underlying type and no enumerator list is "
+                       "only permitted as a standalone declaration");


Reply via email to