On Fri, Sep 1, 2017 at 2:46 PM, Marek Polacek <pola...@redhat.com> wrote:
> @@ -16960,6 +16961,24 @@ cp_parser_simple_type_specifier (cp_parser* parser,
>
>        return type;
>
> +    case RID_REMOVE_QUALS:
> +      /* Consume the `__remove_qualifiers' token.  */
> +      cp_lexer_consume_token (parser->lexer);
> +      /* Parse the operand to __remove_qualifiers`'.  */
> +      type = cp_parser_sizeof_operand (parser, RID_REMOVE_QUALS);

Wouldn't it be simpler to use cp_parser_type_id?

> +      if (!TYPE_P (type))
> +       {
> +         error_at (token->location,
> +                   "%<__remove_qualifiers%> can only be applied to a type");
> +         type = error_mark_node;
> +       }

...rather than check this.

It doesn't look like you handle use of __remove_qualifiers in a
template, and you don't have any testcases for it.

> +@code{__remove_qualifiers} takes a typename as an argument:

I think it would be better to use the term "type-id" here, to avoid
confusion with "type-name", which is only a single identifier.

Jason

Reply via email to