Commit 8535d5aa by Paolo Carlini Committed by Paolo Carlini

parser.c (cp_parser_unqualified_id): Use build_min_nt_loc in five places.

2019-06-03  Paolo Carlini  <paolo.carlini@oracle.com>

	* parser.c (cp_parser_unqualified_id): Use build_min_nt_loc in
      	five places.

From-SVN: r271893
parent c533ffe0
2019-06-03 Paolo Carlini <paolo.carlini@oracle.com>
* parser.c (cp_parser_unqualified_id): Use build_min_nt_loc in
five places.
2019-06-01 Ville Voutilainen <ville.voutilainen@gmail.com> 2019-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
PR c++/85254 PR c++/85254
......
...@@ -6052,7 +6052,7 @@ cp_parser_unqualified_id (cp_parser* parser, ...@@ -6052,7 +6052,7 @@ cp_parser_unqualified_id (cp_parser* parser,
&& constructor_name_p (token->u.value, scope)))) && constructor_name_p (token->u.value, scope))))
{ {
cp_lexer_consume_token (parser->lexer); cp_lexer_consume_token (parser->lexer);
return cp_expr (build_nt (BIT_NOT_EXPR, scope), loc); return build_min_nt_loc (loc, BIT_NOT_EXPR, scope);
} }
/* ~auto means the destructor of whatever the object is. */ /* ~auto means the destructor of whatever the object is. */
...@@ -6063,7 +6063,7 @@ cp_parser_unqualified_id (cp_parser* parser, ...@@ -6063,7 +6063,7 @@ cp_parser_unqualified_id (cp_parser* parser,
"%<~auto%> only available with " "%<~auto%> only available with "
"%<-std=c++14%> or %<-std=gnu++14%>"); "%<-std=c++14%> or %<-std=gnu++14%>");
cp_lexer_consume_token (parser->lexer); cp_lexer_consume_token (parser->lexer);
return cp_expr (build_nt (BIT_NOT_EXPR, make_auto (), loc)); return build_min_nt_loc (loc, BIT_NOT_EXPR, make_auto ());
} }
/* If there was an explicit qualification (S::~T), first look /* If there was an explicit qualification (S::~T), first look
...@@ -6153,8 +6153,8 @@ cp_parser_unqualified_id (cp_parser* parser, ...@@ -6153,8 +6153,8 @@ cp_parser_unqualified_id (cp_parser* parser,
time. */ time. */
type_decl = cp_parser_identifier (parser); type_decl = cp_parser_identifier (parser);
if (type_decl != error_mark_node) if (type_decl != error_mark_node)
type_decl = build_nt (BIT_NOT_EXPR, type_decl); type_decl = build_min_nt_loc (loc, BIT_NOT_EXPR, type_decl);
return cp_expr (type_decl, loc); return type_decl;
} }
} }
/* If an error occurred, assume that the name of the /* If an error occurred, assume that the name of the
...@@ -6162,7 +6162,7 @@ cp_parser_unqualified_id (cp_parser* parser, ...@@ -6162,7 +6162,7 @@ cp_parser_unqualified_id (cp_parser* parser,
class. That allows us to keep parsing after running class. That allows us to keep parsing after running
into ill-formed destructor names. */ into ill-formed destructor names. */
if (type_decl == error_mark_node && scope) if (type_decl == error_mark_node && scope)
return build_nt (BIT_NOT_EXPR, scope); return build_min_nt_loc (loc, BIT_NOT_EXPR, scope);
else if (type_decl == error_mark_node) else if (type_decl == error_mark_node)
return error_mark_node; return error_mark_node;
...@@ -6189,7 +6189,7 @@ cp_parser_unqualified_id (cp_parser* parser, ...@@ -6189,7 +6189,7 @@ cp_parser_unqualified_id (cp_parser* parser,
"typedef-name %qD used as destructor declarator", "typedef-name %qD used as destructor declarator",
type_decl); type_decl);
return cp_expr (build_nt (BIT_NOT_EXPR, TREE_TYPE (type_decl), loc)); return build_min_nt_loc (loc, BIT_NOT_EXPR, TREE_TYPE (type_decl));
} }
case CPP_KEYWORD: case CPP_KEYWORD:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment