Commit 22c6ea00 by Jason Merrill Committed by Jason Merrill

re PR c++/58612 ([c++11] ICE calling non-constexpr from constexpr in template class)

	PR c++/58612
	* tree.c (bot_replace): Only replace a dummy 'this' parm.

From-SVN: r212505
parent 7ce5ae45
2014-07-13 Jason Merrill <jason@redhat.com>
PR c++/58612
* tree.c (bot_replace): Only replace a dummy 'this' parm.
PR c++/60628
* decl.c (create_array_type_for_decl): Only check for auto once.
......
......@@ -2353,7 +2353,8 @@ bot_replace (tree* t, int* /*walk_subtrees*/, void* data)
*t = (tree) n->value;
}
else if (TREE_CODE (*t) == PARM_DECL
&& DECL_NAME (*t) == this_identifier)
&& DECL_NAME (*t) == this_identifier
&& !DECL_CONTEXT (*t))
{
/* In an NSDMI we need to replace the 'this' parameter we used for
parsing with the real one for this function. */
......
// PR c++/58612
// { dg-do compile { target c++11 } }
struct A
{
int foo() const { return 0; }
};
template<typename> struct B
{
A a;
constexpr int bar() { return a.foo(); } // { dg-error "foo" }
};
constexpr int i = B<void>().bar(); // { dg-error "bar" }
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