re PR c++/84493 (ICE with invalid cast)

PR c++/84493
	* parser.c (cp_parser_braced_list): Use require_open instead of
	consume_open.

	* g++.dg/parse/error59.C: New test.

From-SVN: r257899
This commit is contained in:
Marek Polacek 2018-02-22 11:18:37 +00:00 committed by Marek Polacek
parent c8fe60e372
commit caa7952a43
4 changed files with 18 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2018-02-22 Marek Polacek <polacek@redhat.com>
PR c++/84493
* parser.c (cp_parser_braced_list): Use require_open instead of
consume_open.
2018-02-21 Jason Merrill <jason@redhat.com>
PR c++/84454 - ICE with pack expansion in signature.

View File

@ -21925,7 +21925,7 @@ cp_parser_braced_list (cp_parser* parser, bool* non_constant_p)
/* Consume the `{' token. */
matching_braces braces;
braces.consume_open (parser);
braces.require_open (parser);
/* Create a CONSTRUCTOR to represent the braced-initializer. */
initializer = make_node (CONSTRUCTOR);
/* If it's not a `}', then there is a non-trivial initializer. */

View File

@ -1,3 +1,8 @@
2018-02-22 Marek Polacek <polacek@redhat.com>
PR c++/84493
* g++.dg/parse/error59.C: New test.
2018-02-22 Tom de Vries <tom@codesourcery.com>
* gcc.c-torture/execute/pr82210.c: Require effective target alloca.

View File

@ -0,0 +1,6 @@
// PR c++/84493
void foo()
{
(struct {}x){}; // { dg-error "" }
}