PR c++/35985
* decl.c (xref_basetypes): Check base for MAYBE_CLASS_TYPE_P,
and make sure it is not a union.
* g++.dg/inherit/base3.C: New.
From-SVN: r138886
+2008-08-08 Volker Reichelt <v.reichelt@netcologne.de>
+
+ PR c++/35985
+ * decl.c (xref_basetypes): Check base for MAYBE_CLASS_TYPE_P,
+ and make sure it is not a union.
+
2008-08-07 H.J. Lu <hongjiu.lu@intel.com>
* semantics.c (finish_decltype_type): Initialize type.
basetype = PACK_EXPANSION_PATTERN (basetype);
if (TREE_CODE (basetype) == TYPE_DECL)
basetype = TREE_TYPE (basetype);
- if (TREE_CODE (basetype) != RECORD_TYPE
- && TREE_CODE (basetype) != TYPENAME_TYPE
- && TREE_CODE (basetype) != TEMPLATE_TYPE_PARM
- && TREE_CODE (basetype) != BOUND_TEMPLATE_TEMPLATE_PARM)
+ if (!MAYBE_CLASS_TYPE_P (basetype) || TREE_CODE (basetype) == UNION_TYPE)
{
error ("base type %qT fails to be a struct or class type",
basetype);
+2008-08-08 Volker Reichelt <v.reichelt@netcologne.de>
+
+ PR c++/35985
+ * g++.dg/inherit/base3.C: New.
+
2008-08-08 Dorit Nuzman <dorit@il.ibm.com>
* lib/target-supports.exp (check_effective_target_vect_floatint_cvt):
--- /dev/null
+// PR c++/35985
+// { dg-do compile }
+
+template<typename T> struct A : T {}; // { dg-error "struct or class type" }
+
+struct B;
+
+A<void (B::*)()> a; // { dg-error "instantiated" }