diff options
author | Dave Brolley <brolley@redhat.com> | 2007-07-03 20:21:33 -0400 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2007-07-04 00:21:33 +0000 |
commit | 39fb9d7250581a22c2d773457255dc61a51e0099 (patch) | |
tree | 8c59baf94a71413e1d59612c1d7bbe72c890bd64 /gcc/testsuite | |
parent | 61087eb3c459a7c729ded6e0cdf10edc1d8d7d76 (diff) | |
download | gcc-39fb9d7250581a22c2d773457255dc61a51e0099.zip gcc-39fb9d7250581a22c2d773457255dc61a51e0099.tar.gz gcc-39fb9d7250581a22c2d773457255dc61a51e0099.tar.bz2 |
re PR c++/31743 (ICE with invalid use of new)
PR c++/31743
* parser.c (cp_parser_new_type_id): Don't reduce a named array
type to its base type and number of elements here.
* init.c (build_new): Call complete_type_or_else to ensure that the
type is complete and to issue a diagnostic if it is not.
(build_new_1): Don't call complete_type_or_else here.
PR c++/31743
* g++.dg/init/new20.C: New test.
From-SVN: r126292
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rwxr-xr-x | gcc/testsuite/g++.dg/init/new20.C | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fc5dca3..97d5e2b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-06-29 Dave Brolley <brolley@redhat.com> + + PR c++/31743 + * g++.dg/init/new20.C: New test. + 2007-07-03 Christopher D. Rickett <crickett@lanl.gov> PR fortran/32579 diff --git a/gcc/testsuite/g++.dg/init/new20.C b/gcc/testsuite/g++.dg/init/new20.C new file mode 100755 index 0000000..705c1be --- /dev/null +++ b/gcc/testsuite/g++.dg/init/new20.C @@ -0,0 +1,6 @@ +// PR c++/31743
+typedef int A[];
+A* p = new A; // { dg-error "invalid use of array with unspecified bounds" }
+A* q = new (A); // { dg-error "invalid use of array with unspecified bounds" }
+
+
|