From: Fabien Chêne Date: Mon, 9 May 2011 20:56:29 +0000 (+0200) Subject: re PR c++/20039 (uninitialized const in `new' of `const struct') X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9420e113a12ecabc02aa996378690a63656a59d4;p=gcc.git re PR c++/20039 (uninitialized const in `new' of `const struct') gcc/testsuite/ChangeLog: 2011-05-09 Fabien Chene PR c++/20039 * g++.dg/init/pr20039.C: New. From-SVN: r173592 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 82478ea5c0e..b7aa65640a0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2011-05-09 Fabien Chêne + PR c++/20039 + * g++.dg/init/pr20039.C: New. + 2011-05-09 Paolo Carlini PR c++/48737 @@ -9,7 +13,7 @@ * g++.dg/template/nontype23.C: New. -2001-05-07 Fabien Chêne +2011-05-07 Fabien Chêne 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 index 00000000000..9b0c12d6ea3 --- /dev/null +++ b/gcc/testsuite/g++.dg/init/pr20039.C @@ -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; +}