PR c++/58612
* tree.c (bot_replace): Only replace a dummy 'this' parm.
From-SVN: r212505
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.
*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. */
--- /dev/null
+// 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" }