re PR c++/61323 ('static' and 'const' attributes cause non-type template argument...
authorPaolo Carlini <paolo.carlini@oracle.com>
Mon, 16 Oct 2017 08:25:31 +0000 (08:25 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 16 Oct 2017 08:25:31 +0000 (08:25 +0000)
2017-10-16  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/61323
* g++.dg/cpp0x/constexpr-61323.C: New.

From-SVN: r253777

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/constexpr-61323.C [new file with mode: 0644]

index ff99cba66b702cadd4360a963a476ca5677310ed..3458692fcd388fed704455e8d139a44fa9a93a61 100644 (file)
@@ -1,3 +1,8 @@
+2017-10-16  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/61323
+       * g++.dg/cpp0x/constexpr-61323.C: New.
+
 2017-10-15  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/54090
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-61323.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-61323.C
new file mode 100644 (file)
index 0000000..f194bb8
--- /dev/null
@@ -0,0 +1,26 @@
+// PR c++/61323
+// { dg-do compile { target c++11 } }
+
+char* table1[10];
+template<unsigned size, char*(&table)[size]> void test1() { }
+void tester1() { test1<10,table1>(); }
+
+static char* table2[10];
+template<unsigned size, char*(&table)[size]> void test2() { }
+void tester2() { test2<10,table2>(); }
+
+const char* table3[10];
+template<unsigned size, const char*(&table)[size]> void test3() { }
+void tester3() { test3<10,table3>(); }
+
+const char* const table4[10] = {};
+template<unsigned size, const char*const (&table)[size]> void test4() { }
+void tester4() { test4<10,table4>(); }
+
+const char* volatile table5[10] = {};
+template<unsigned size, const char* volatile (&table)[size]> void test5() { }
+void tester5() { test5<10,table5>(); }
+
+const char* const table6[10] = {};
+template<unsigned size, const char*const (&table)[size]> void test6() { }
+void tester6() { test6<10,table6>(); }