aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp1z/nontype-auto13.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp1z/nontype-auto13.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/nontype-auto13.C18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp1z/nontype-auto13.C b/gcc/testsuite/g++.dg/cpp1z/nontype-auto13.C
new file mode 100644
index 00000000000..2152cef811e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1z/nontype-auto13.C
@@ -0,0 +1,18 @@
+// PR c++/82331
+// { dg-options -std=c++17 }
+
+template <auto>
+class X;
+
+template <typename R, typename... A, R (*F) (A...)>
+class X<F> {
+public:
+ static R call (A... args)
+ {
+ return (*F)(args...);
+ }
+};
+
+int func (int a, int b) { return a + b; }
+
+int test () { return X<&func>::call(1, 2); }