mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-25 18:46:02 +08:00
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
This commit is contained in:
parent
7ce5ae457b
commit
22c6ea0042
@ -1,5 +1,8 @@
|
||||
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. */
|
||||
|
15
gcc/testsuite/g++.dg/cpp0x/constexpr-neg3.C
Normal file
15
gcc/testsuite/g++.dg/cpp0x/constexpr-neg3.C
Normal file
@ -0,0 +1,15 @@
|
||||
// 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" }
|
Loading…
Reference in New Issue
Block a user