aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp1y/auto-fn10.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp1y/auto-fn10.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/cpp1y/auto-fn10.C16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp1y/auto-fn10.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp1y/auto-fn10.C
new file mode 100644
index 000000000..890cfda12
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp1y/auto-fn10.C
@@ -0,0 +1,16 @@
+// A template declared with auto should be declared with auto in an
+// explicit instantiation or explicit specialization, too.
+// { dg-do compile { target c++1y } }
+
+template <class T>
+auto f(T t) { return t; }
+
+template<> auto f<int>(int);
+template auto f<float>(float);
+template<> auto f(int*);
+template auto f(float*);
+
+template<> short f<short>(short); // { dg-error "does not match" }
+template char f<char>(char); // { dg-error "does not match" }
+template<> short f(short*); // { dg-error "does not match" }
+template char f(char*); // { dg-error "does not match" }