[PATCH] C++: fix fix-it hints for misspellings within explicit namespaces (v2)

Jason Merrill jason@redhat.com
Thu Jan 19 18:18:00 GMT 2017


On Wed, Jan 18, 2017 at 5:29 PM, David Malcolm <dmalcolm@redhat.com> wrote:
> Here's a version of the patch which simply tweaks
> cp_parser_primary_expression's call to finish_id_expression so that
> it passes the location of the id_expression, rather than that of
> id_expr_token.
>
> The id_expression in question came from cp_parser_id_expression,
> whereas the id_expr_token is the first token within the id-expression.
>
> The location passed here to finish_id_expression only affects:
> the location used for name-lookup errors, and for the resulting
> decl cp_expr.  Given that the following code immediately does this:
>         decl.set_location (id_expr_token->location);

What happens if we use id_expression.get_location() here, too?

OK.

Jason



More information about the Gcc-patches mailing list