===================================================================
@@ -13599,8 +13599,9 @@ tsubst_copy (tree t, tree args, tsubst_flags_t com
if (r)
{
/* Make sure that the one we found is the one we want. */
- tree ctx = tsubst (DECL_CONTEXT (t), args,
- complain, in_decl);
+ tree ctx = DECL_CONTEXT (t);
+ if (DECL_LANG_SPECIFIC (ctx) && DECL_TEMPLATE_INFO (ctx))
+ ctx = tsubst (ctx, args, complain, in_decl);
if (ctx != DECL_CONTEXT (r))
r = NULL_TREE;
}
===================================================================
@@ -0,0 +1,10 @@
+// PR c++/67369
+// { dg-do compile { target c++14 } }
+
+int main() {
+ unsigned const nsz = 0;
+ auto repeat_conditional = [&](auto) {
+ auto new_sz = nsz;
+ };
+ repeat_conditional(1);
+}