mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-17 09:30:30 +08:00
re PR c++/84605 (internal compiler error: in xref_basetypes, at cp/decl.c:13818)
/cp 2019-03-04 Paolo Carlini <paolo.carlini@oracle.com> PR c++/84605 * parser.c (cp_parser_class_head): Reject TYPE_BEING_DEFINED too. /testsuite 2019-03-04 Paolo Carlini <paolo.carlini@oracle.com> PR c++/84605 * g++.dg/parse/crash69.C: New. From-SVN: r269378
This commit is contained in:
parent
94014ee95b
commit
b65e6a9977
@ -1,3 +1,8 @@
|
||||
2019-03-04 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/84605
|
||||
* parser.c (cp_parser_class_head): Reject TYPE_BEING_DEFINED too.
|
||||
|
||||
2019-03-04 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/71446
|
||||
|
@ -24021,8 +24021,11 @@ cp_parser_class_head (cp_parser* parser,
|
||||
cp_parser_check_class_key (class_key, type);
|
||||
|
||||
/* If this type was already complete, and we see another definition,
|
||||
that's an error. */
|
||||
if (type != error_mark_node && COMPLETE_TYPE_P (type))
|
||||
that's an error. Likewise if the type is already being defined:
|
||||
this can happen, eg, when it's defined from within an expression
|
||||
(c++/84605). */
|
||||
if (type != error_mark_node
|
||||
&& (COMPLETE_TYPE_P (type) || TYPE_BEING_DEFINED (type)))
|
||||
{
|
||||
error_at (type_start_token->location, "redefinition of %q#T",
|
||||
type);
|
||||
|
@ -1,3 +1,8 @@
|
||||
2019-03-04 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/84605
|
||||
* g++.dg/parse/crash69.C: New.
|
||||
|
||||
2019-03-04 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/71446
|
||||
|
11
gcc/testsuite/g++.dg/parse/crash69.C
Normal file
11
gcc/testsuite/g++.dg/parse/crash69.C
Normal file
@ -0,0 +1,11 @@
|
||||
// PR c++/84605
|
||||
|
||||
struct b {
|
||||
int x(((struct b {}))); // { dg-error "expected|redefinition" }
|
||||
};
|
||||
|
||||
struct c {
|
||||
struct d {
|
||||
int x(((struct c {}))); // { dg-error "expected|redefinition" }
|
||||
};
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user