/cp
2018-01-18 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/81013
* decl.c (xref_basetypes): Early return upon error about derived
union.
/testsuite
2018-01-18 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/81013
* g++.dg/inherit/union3.C: New.
From-SVN: r256856
+2018-01-18 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/81013
+ * decl.c (xref_basetypes): Early return upon error about derived
+ union.
+
2018-01-18 Nathan Sidwell <nathan@acm.org>
PR c++/83160
CLASSTYPE_NON_LAYOUT_POD_P (ref) = true;
if (TREE_CODE (ref) == UNION_TYPE)
- error ("derived union %qT invalid", ref);
+ {
+ error ("derived union %qT invalid", ref);
+ return;
+ }
}
if (max_bases > 1)
+2018-01-18 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/81013
+ * g++.dg/inherit/union3.C: New.
+
2018-01-18 Christophe Lyon <christophe.lyon@linaro.org>
* gcc.dg/rtl/arm/stl-cond.c: Enable on arm*.
--- /dev/null
+// PR c++/81013
+
+struct A
+{
+ virtual void foo() const;
+};
+
+union B : A // { dg-error "derived union 'B' invalid" }
+{
+ void foo() const;
+};
+
+void bar(const B& b)
+{
+ b.foo();
+}