Commit 2bb03eb7 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/84557 (ICE with invalid firstprivate variable)

	PR c++/84557
	* parser.c (cp_parser_omp_var_list_no_open): Only call
	cp_parser_lookup_name_simple on names satisfying identifier_p.
	(cp_parser_oacc_routine): Likewise.

	* g++.dg/gomp/pr84557.C: New test.

From-SVN: r258011
parent e5868319
2018-02-26 Jakub Jelinek <jakub@redhat.com>
PR c++/84557
* parser.c (cp_parser_omp_var_list_no_open): Only call
cp_parser_lookup_name_simple on names satisfying identifier_p.
(cp_parser_oacc_routine): Likewise.
2018-02-26 Jason Merrill <jason@redhat.com>
PR c++/84551 - ICE with concepts and -g.
......
......@@ -31342,7 +31342,10 @@ cp_parser_omp_var_list_no_open (cp_parser *parser, enum omp_clause_code kind,
if (name == error_mark_node)
goto skip_comma;
decl = cp_parser_lookup_name_simple (parser, name, token->location);
if (identifier_p (name))
decl = cp_parser_lookup_name_simple (parser, name, token->location);
else
decl = name;
if (decl == error_mark_node)
cp_parser_name_lookup_error (parser, name, decl, NLE_NULL,
token->location);
......@@ -37846,7 +37849,9 @@ cp_parser_oacc_routine (cp_parser *parser, cp_token *pragma_tok,
/*template_p=*/NULL,
/*declarator_p=*/false,
/*optional_p=*/false);
tree decl = cp_parser_lookup_name_simple (parser, name, name_loc);
tree decl = (identifier_p (name)
? cp_parser_lookup_name_simple (parser, name, name_loc)
: name);
if (name != error_mark_node && decl == error_mark_node)
cp_parser_name_lookup_error (parser, name, decl, NLE_NULL, name_loc);
2018-02-26 Jakub Jelinek <jakub@redhat.com>
PR c++/84557
* g++.dg/gomp/pr84557.C: New test.
2018-02-26 Marek Polacek <polacek@redhat.com>
PR c++/84325
......
// PR c++/84557
// { dg-do compile }
template<int> struct A {};
template<int> struct B {};
void
foo ()
{
#pragma omp parallel firstprivate (A) // { dg-error "is not a variable in clause" }
;
#pragma omp parallel firstprivate (B<0>) // { dg-error "is not a variable in clause" }
;
}
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