]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: Add testcase for already fixed PR [PR109506]
authorPatrick Palka <ppalka@redhat.com>
Tue, 2 May 2023 12:48:59 +0000 (08:48 -0400)
committerPatrick Palka <ppalka@redhat.com>
Tue, 2 May 2023 12:48:59 +0000 (08:48 -0400)
The PR109666 fix r14-386-g07c52d1eec967 incidentally also fixes this PR.

PR c++/109506

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/nsdmi-template26.C: New test.

gcc/testsuite/g++.dg/cpp0x/nsdmi-template26.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi-template26.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi-template26.C
new file mode 100644 (file)
index 0000000..032b7b6
--- /dev/null
@@ -0,0 +1,22 @@
+// PR c++/109506
+// { dg-do link { target c++11 } }
+// { dg-additional-options "-fchecking=2" }
+
+template<class T>
+struct foo {
+  foo() { };
+};
+
+template<class T>
+class bar {
+  foo<int> alloc_{};
+};
+
+template<class T>
+bar<int> func1() {
+  return bar<int>{};
+}
+
+int main() {
+  func1<int>();
+}