re PR c++/52742 (Initializing an array using brace initializer and template parameters)
authorPaolo Carlini <paolo.carlini@oracle.com>
Wed, 12 Aug 2015 17:18:14 +0000 (17:18 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 12 Aug 2015 17:18:14 +0000 (17:18 +0000)
2015-08-12  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/52742
* g++.dg/cpp0x/pr52742.C: New.

From-SVN: r226824

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

index 4d053d2bf10fd45ed6c4875e2202d329781da8a4..d18a406ba11618ca589389742b20c7aeafb098ce 100644 (file)
@@ -1,3 +1,8 @@
+2015-08-12  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/52742
+       * g++.dg/cpp0x/pr52742.C: New.
+
 2015-08-12  H.J. Lu  <hongjiu.lu@intel.com>
 
        * gcc.target/i386/builtin_target.c (check_intel_cpu_model):
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr52742.C b/gcc/testsuite/g++.dg/cpp0x/pr52742.C
new file mode 100644 (file)
index 0000000..f4d3dec
--- /dev/null
@@ -0,0 +1,16 @@
+// PR c++/52742
+// { dg-do compile { target c++11 } }
+
+void foo() {
+  new int[1] {1};
+}
+
+template<int A>
+void goo() {
+  new int[1] {1};
+}
+
+int main() {
+  foo();
+  goo<1>();
+}