]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: add fixed test [PR119378]
authorPatrick Palka <ppalka@redhat.com>
Fri, 21 Mar 2025 19:23:49 +0000 (15:23 -0400)
committerPatrick Palka <ppalka@redhat.com>
Fri, 21 Mar 2025 19:23:49 +0000 (15:23 -0400)
Fixed by r15-123 (specifically the change to set processing_template_decl
when tsubsting UNBOUND_CLASS_TEMPLATE).

PR c++/119378

gcc/testsuite/ChangeLog:

* g++.dg/template/friend85.C: New test.

gcc/testsuite/g++.dg/template/friend85.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/template/friend85.C b/gcc/testsuite/g++.dg/template/friend85.C
new file mode 100644 (file)
index 0000000..5cf8391
--- /dev/null
@@ -0,0 +1,16 @@
+// PR c++/119378
+
+template<int N>
+struct A {
+  template<class T>
+  struct B;
+};
+
+template<class U>
+struct C {
+  template<int N>
+  template<class T>
+  friend class A<N>::B;
+};
+
+template struct C<int>;