]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: add fixed test [PR82936]
authorMarek Polacek <polacek@redhat.com>
Fri, 14 Feb 2025 21:18:25 +0000 (16:18 -0500)
committerMarek Polacek <polacek@redhat.com>
Fri, 14 Feb 2025 21:18:48 +0000 (16:18 -0500)
Fixed by r8-6829-gaaec81f10fa314; before that:

Segmentation fault (core dumped)

PR c++/82936

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/vt-82936.C: New test.

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

diff --git a/gcc/testsuite/g++.dg/cpp0x/vt-82936.C b/gcc/testsuite/g++.dg/cpp0x/vt-82936.C
new file mode 100644 (file)
index 0000000..3c48968
--- /dev/null
@@ -0,0 +1,18 @@
+// PR c++/82936
+// { dg-do compile { target c++11 } }
+
+int fun(int i)
+{
+    return 0;
+}
+template <typename F>
+struct outer;
+template <typename R, typename ...Args>
+struct outer<R(Args...)>
+{
+    template <R(& f)(Args...)>
+    struct callable
+    {
+    };
+};
+outer<int(int)>::callable<fun> f;