re PR c++/24314 (Extra "template<>" in partial specialization is compiled successfuly.)
authorPaolo Carlini <paolo.carlini@oracle.com>
Tue, 10 Apr 2018 13:40:35 +0000 (13:40 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Tue, 10 Apr 2018 13:40:35 +0000 (13:40 +0000)
2018-04-10  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/24314
* g++.dg/parse/template29.C: New.

From-SVN: r259273

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/parse/template29.C [new file with mode: 0644]

index 11e18865164c301d1df627b00f10607461f41592..80ad244e3e642a770465e6f58d233780f1522209 100644 (file)
@@ -1,3 +1,8 @@
+2018-04-10  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/24314
+       * g++.dg/parse/template29.C: New.
+
 2018-04-10  Bin Cheng  <bin.cheng@arm.com>
 
        PR testsuite/85190
diff --git a/gcc/testsuite/g++.dg/parse/template29.C b/gcc/testsuite/g++.dg/parse/template29.C
new file mode 100644 (file)
index 0000000..46033cb
--- /dev/null
@@ -0,0 +1,31 @@
+// PR c++/24314
+
+// The base template.
+template <class T>
+struct A
+{
+   int select() { return 0; }
+};
+
+//Extra "template<>"
+template <>
+template <>
+template <>
+template <>
+template <>
+template <>
+template <>
+template <>
+template <>
+template <>
+template <>
+template <class T>
+struct A<T*>  // { dg-error "too many template-parameter-lists" }
+{
+   int select() { return 1; }
+};
+
+int main()
+{
+   return A<int*>().select();
+}