re PR c++/51612 ([c++0x] [4.6/4.7 Regression] ICE with constexpr constructor and virtual base class)
/cp 2011-12-20 Paolo Carlini <paolo.carlini@oracle.com> PR c++/51612 * semantics.c (is_valid_constexpr_fn): In case of constexpr constructors also check for virtual base classes. /testsuite 2011-12-20 Paolo Carlini <paolo.carlini@oracle.com> PR c++/51612 * g++.dg/cpp0x/constexpr-ice4.C: New. From-SVN: r182526
This commit is contained in:
parent
336e404f9f
commit
f0bc5f840f
4 changed files with 26 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
|||
2011-12-20 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/51612
|
||||
* semantics.c (is_valid_constexpr_fn): In case of constexpr
|
||||
constructors also check for virtual base classes.
|
||||
|
||||
2011-12-19 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/51328
|
||||
|
|
|
@ -5730,6 +5730,12 @@ is_valid_constexpr_fn (tree fun, bool complain)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (CLASSTYPE_VBASECLASSES (DECL_CONTEXT (fun)))
|
||||
{
|
||||
ret = false;
|
||||
if (complain)
|
||||
error ("%q#T has virtual base classes", DECL_CONTEXT (fun));
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2011-12-20 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/51612
|
||||
* g++.dg/cpp0x/constexpr-ice4.C: New.
|
||||
|
||||
2011-12-19 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/51328
|
||||
|
|
9
gcc/testsuite/g++.dg/cpp0x/constexpr-ice4.C
Normal file
9
gcc/testsuite/g++.dg/cpp0x/constexpr-ice4.C
Normal file
|
@ -0,0 +1,9 @@
|
|||
// PR c++/51612
|
||||
// { dg-options -std=c++0x }
|
||||
|
||||
struct A {};
|
||||
|
||||
struct B : virtual A
|
||||
{
|
||||
constexpr B() { } // { dg-error "has virtual base classes" }
|
||||
};
|
Loading…
Add table
Reference in a new issue