re PR c/68107 (Non-VLA type whose size is half or more of the address space construct...
authorMarek Polacek <polacek@redhat.com>
Wed, 11 Nov 2015 14:47:03 +0000 (14:47 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Wed, 11 Nov 2015 14:47:03 +0000 (14:47 +0000)
commite78bede6f774bc0d294adafe5e3367c4da10647e
tree48b3e7d70614879dd48b43b013beb7831d9ad8ba
parenta5b50aa1fb086c90dd0119f8cb9e0a88ea9cce58
re PR c/68107 (Non-VLA type whose size is half or more of the address space constructed via a pointer)

PR c/68107
PR c++/68266
* c-common.c (valid_array_size_p): New function.
* c-common.h (valid_array_size_p): Declare.

* c-decl.c (grokdeclarator): Call valid_array_size_p.  Remove code
checking the size of an array.

* decl.c (grokdeclarator): Call valid_array_size_p.  Remove code
checking the size of an array.

* c-c++-common/pr68107.c: New test.
* g++.dg/init/new38.C (large_array_char): Adjust dg-error.
(large_array_char_template): Likewise.
* g++.dg/init/new44.C: Adjust dg-error.

From-SVN: r230174
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c-family/c-common.h
gcc/c/ChangeLog
gcc/c/c-decl.c
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/pr68107.c [new file with mode: 0644]
gcc/testsuite/g++.dg/init/new38.C
gcc/testsuite/g++.dg/init/new44.C