aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/pt.c2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/lambda-generic9.C9
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index bcf4c6e..373f827 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -15688,6 +15688,8 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
else if (tree pl = CLASS_PLACEHOLDER_TEMPLATE (t))
{
pl = tsubst_copy (pl, args, complain, in_decl);
+ if (TREE_CODE (pl) == TEMPLATE_TEMPLATE_PARM)
+ pl = TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL (pl);
CLASS_PLACEHOLDER_TEMPLATE (r) = pl;
}
}
diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-generic9.C b/gcc/testsuite/g++.dg/cpp2a/lambda-generic9.C
new file mode 100644
index 0000000..20ceb37
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/lambda-generic9.C
@@ -0,0 +1,9 @@
+// PR c++/95434
+// { dg-do compile { target c++20 } }
+
+template <class>
+void f() {
+ [] <template <class> class U> { U{0}; };
+}
+
+template void f<int>();