Commit f0bc5f84 by Paolo Carlini Committed by Paolo Carlini

re PR c++/51612 ([c++0x] [4.6/4.7 Regression] ICE with constexpr constructor and…

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
parent 336e404f
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;
}
......
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
......
// PR c++/51612
// { dg-options -std=c++0x }
struct A {};
struct B : virtual A
{
constexpr B() { } // { dg-error "has virtual base classes" }
};
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