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
This commit is contained in:
parent
7910ae0cde
commit
76871f0f31
4 changed files with 20 additions and 4 deletions
|
@ -1,3 +1,9 @@
|
|||
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);
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
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):
|
||||
|
|
8
gcc/testsuite/g++.dg/inherit/base3.C
Normal file
8
gcc/testsuite/g++.dg/inherit/base3.C
Normal file
|
@ -0,0 +1,8 @@
|
|||
// 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" }
|
Loading…
Add table
Reference in a new issue