Commit 76871f0f by Volker Reichelt Committed by Volker Reichelt

re PR c++/35985 (ICE with pointer to member function as base)

	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
parent 7910ae0c
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.
......
......@@ -10616,10 +10616,7 @@ xref_basetypes (tree ref, tree base_list)
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):
......
// 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" }
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