PR c++/92450 - ICE with invalid nested name specifier.
* parser.c (cp_parser_member_declaration): Don't attempt to print erroneous bit-field diagnostic if grokdeclarator returns error_mark_node. * g++.dg/parse/crash71.C: New test. From-SVN: r278570
This commit is contained in:
parent
7c6f2fb9c7
commit
523cfd52a2
4 changed files with 27 additions and 3 deletions
|
@ -1,3 +1,10 @@
|
|||
2019-11-21 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR c++/92450 - ICE with invalid nested name specifier.
|
||||
* parser.c (cp_parser_member_declaration): Don't attempt to print
|
||||
erroneous bit-field diagnostic if grokdeclarator returns
|
||||
error_mark_node.
|
||||
|
||||
2019-11-21 Jakub Jelinek <jakub@redhat.com>
|
||||
Jason Merrill <jason@redhat.com>
|
||||
|
||||
|
|
|
@ -25062,9 +25062,10 @@ cp_parser_member_declaration (cp_parser* parser)
|
|||
tree d = grokdeclarator (declarator, &decl_specifiers,
|
||||
BITFIELD, /*initialized=*/false,
|
||||
&attributes);
|
||||
error_at (DECL_SOURCE_LOCATION (d),
|
||||
"bit-field %qD has non-integral type %qT",
|
||||
d, TREE_TYPE (d));
|
||||
if (!error_operand_p (d))
|
||||
error_at (DECL_SOURCE_LOCATION (d),
|
||||
"bit-field %qD has non-integral type %qT",
|
||||
d, TREE_TYPE (d));
|
||||
cp_parser_skip_to_end_of_statement (parser);
|
||||
/* Avoid "extra ;" pedwarns. */
|
||||
if (cp_lexer_next_token_is (parser->lexer,
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2019-11-21 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR c++/92450 - ICE with invalid nested name specifier.
|
||||
* g++.dg/parse/crash71.C: New test.
|
||||
|
||||
2019-11-21 Wilco Dijkstra <wdijkstr@arm.com>
|
||||
|
||||
* gfortran.dg/global_vars_f90_init_driver.c: Add missing extern.
|
||||
|
|
11
gcc/testsuite/g++.dg/parse/crash71.C
Normal file
11
gcc/testsuite/g++.dg/parse/crash71.C
Normal file
|
@ -0,0 +1,11 @@
|
|||
// PR c++/92450 - ICE with invalid nested name specifier.
|
||||
|
||||
typedef int C2;
|
||||
struct B1 {
|
||||
struct B2 {
|
||||
};
|
||||
};
|
||||
|
||||
struct S6g {
|
||||
C2 : B1:B2; // { dg-error "" }
|
||||
};
|
Loading…
Add table
Reference in a new issue