Commit 909a11ad by Paolo Carlini Committed by Paolo Carlini

re PR c++/70202 (ICE on invalid code on x86_64-linux-gnu in…

re PR c++/70202 (ICE on invalid code on x86_64-linux-gnu in build_simple_base_path, at cp/class.c:579)

/cp
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-04  Paolo Carlini  <paolo.carlini@oracle.com>

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

From-SVN: r237089
parent c389d349
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-03 Patrick Palka <ppalka@gcc.gnu.org> 2016-06-03 Patrick Palka <ppalka@gcc.gnu.org>
PR c++/27100 PR c++/27100
......
...@@ -22050,9 +22050,8 @@ cp_parser_class_head (cp_parser* parser, ...@@ -22050,9 +22050,8 @@ cp_parser_class_head (cp_parser* parser,
/* If we're really defining a class, process the base classes. /* If we're really defining a class, process the base classes.
If they're invalid, fail. */ If they're invalid, fail. */
if (type && cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE) if (type && cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE))
&& !xref_basetypes (type, bases)) xref_basetypes (type, bases);
type = NULL_TREE;
done: done:
/* Leave the scope given by the nested-name-specifier. We will /* Leave the scope given by the nested-name-specifier. We will
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-03 Jeff Law <law@redhat.com> 2016-06-03 Jeff Law <law@redhat.com>
PR tree-optimization/71316 PR tree-optimization/71316
......
// PR c++/70202
class A
{
virtual void foo () { }
};
class B : public A, A { }; // { dg-error "duplicate base type" }
B b1, &b2 = b1;
A a = b2;
...@@ -5,8 +5,8 @@ struct A ...@@ -5,8 +5,8 @@ struct A
virtual ~A() {} virtual ~A() {}
}; };
struct B : A, virtual A {}; // { dg-error "duplicate base|forward declaration" } struct B : A, virtual A {}; // { dg-error "duplicate base" }
struct C : A, B {}; // { dg-error "duplicate base|invalid use" } struct C : A, B {}; // { dg-error "duplicate base" }
C c; // { dg-error "aggregate" } C c;
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