+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>
PR c++/27100
/* 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))
- type = NULL_TREE;
+ if (type && cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE))
+ xref_basetypes (type, bases);
done:
/* 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>
PR tree-optimization/71316
--- /dev/null
+// 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;
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;