On 10/23/18 6:08 PM, Martin Sebor wrote:
+ if (cp_parser_parse_definitely (parser))
+ {
+ /* If all went well, set OPER to the type. */
+ cp_decl_specifier_seq decl_specs;
+
+ /* Build a trivial decl-specifier-seq. */
+ clear_decl_specs (&decl_specs);
+ decl_specs.type = oper;
+ }
+
+ /* If the type-id production did not work out, then we must be
+ looking at the unary-expression production. */
+ if (!oper || oper == error_mark_node)
+ oper = cp_parser_unary_expression (parser);
The decl_specs stuff is still unneeded; I think all this can be
simplified to
if (!cp_parser_parse_definitely (parser))
oper = cp_parser_unary_expression (parser);
The C++ bits are OK with that change.
You probably want a follow-on patch to handle
template-argument-dependent cases, like when the alignment argument
depends on a template parameter.
Jason