re PR c++/20039 (uninitialized const in `new' of `const struct')
authorFabien Chêne <fabien@gcc.gnu.org>
Mon, 9 May 2011 20:56:29 +0000 (22:56 +0200)
committerFabien Chêne <fabien@gcc.gnu.org>
Mon, 9 May 2011 20:56:29 +0000 (22:56 +0200)
gcc/testsuite/ChangeLog:

2011-05-09  Fabien Chene  <fabien@gcc.gnu.org>
PR c++/20039
* g++.dg/init/pr20039.C: New.

From-SVN: r173592

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

index 82478ea5c0e0e6be8175fbfa07dcb2f8237f86b7..b7aa65640a04d1f40ed7e95765c90c6efdfc88ec 100644 (file)
@@ -1,3 +1,7 @@
+2011-05-09  Fabien Chêne  <fabien@gcc.gnu.org>
+       PR c++/20039
+       * g++.dg/init/pr20039.C: New.
+
 2011-05-09  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/48737
@@ -9,7 +13,7 @@
 
        * g++.dg/template/nontype23.C: New.
 
-2001-05-07  Fabien Chêne  <fabien@gcc.gnu.org>
+2011-05-07  Fabien Chêne  <fabien@gcc.gnu.org>
        PR c++/48859
        * g++.dg/init/pr48859.C: New.
 
diff --git a/gcc/testsuite/g++.dg/init/pr20039.C b/gcc/testsuite/g++.dg/init/pr20039.C
new file mode 100644 (file)
index 0000000..9b0c12d
--- /dev/null
@@ -0,0 +1,19 @@
+// PR c++/20039
+// { dg-do compile }
+
+struct M
+{
+  M() : m(0) { }
+  int m;
+};
+
+struct X
+{
+  M m;
+};
+
+int mymain()
+{
+  const X *p = new const X[2]; // { dg-error "uninitialized const" }
+  return 0;
+}