Commit 392a81b9 by Paolo Carlini Committed by Paolo Carlini

re PR c++/71465 (ICE on invalid C++ code (with duplicate base) on…

re PR c++/71465 (ICE on invalid C++ code (with duplicate base) on x86_64-linux-gnu: in dfs_build_secondary_vptr_vtt_inits, at cp/class.c:9075)

/cp
2016-06-09  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/71465
	Revert:
	2016-06-04  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/70202
	* parser.c (cp_parser_class_head): When xref_basetypes fails and
	emits an error do not zero the type.
	
/testsuite
2016-06-09  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/71465
	* g++.dg/inherit/crash5.C: New.
	Revert:
	2016-06-04  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/70202
	* g++.dg/inherit/crash5.C: New.
	* g++.dg/inherit/virtual1.C: Adjust.

From-SVN: r237258
parent fdf3a386
2016-06-09 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/71465
Revert:
2016-06-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/70202
* parser.c (cp_parser_class_head): When xref_basetypes fails and
emits an error do not zero the type.
2016-06-08 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (maybe_deduce_size_from_array_init): Use
......
......@@ -22050,8 +22050,9 @@ cp_parser_class_head (cp_parser* parser,
/* If we're really defining a class, process the base classes.
If they're invalid, fail. */
if (type && cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE))
xref_basetypes (type, bases);
if (type && cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE)
&& !xref_basetypes (type, bases))
type = NULL_TREE;
done:
/* Leave the scope given by the nested-name-specifier. We will
2016-06-09 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/71465
* g++.dg/inherit/crash5.C: New.
Revert:
2016-06-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/70202
* g++.dg/inherit/crash5.C: New.
* g++.dg/inherit/virtual1.C: Adjust.
2016-06-09 Martin Liska <mliska@suse.cz>
* g++.dg/predict-loop-exit-1.C: Scan for a new dump format.
......
// PR c++/70202
// PR c++/71465
class A
{
virtual void foo () { }
};
class B : public A, A { }; // { dg-error "duplicate base type" }
B b1, &b2 = b1;
A a = b2;
struct A { virtual void foo () {} };
struct B : virtual A {};
struct C : virtual A {};
struct D : C, B, C {}; // { dg-error "duplicate base type" }
......@@ -5,8 +5,8 @@ struct A
virtual ~A() {}
};
struct B : A, virtual A {}; // { dg-error "duplicate base" }
struct B : A, virtual A {}; // { dg-error "duplicate base|forward declaration" }
struct C : A, B {}; // { dg-error "duplicate base" }
struct C : A, B {}; // { dg-error "duplicate base|invalid use" }
C c;
C c; // { dg-error "aggregate" }
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