]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/cp/tree.c
N3639 C++1y VLA support
authorJason Merrill <jason@redhat.com>
Thu, 9 May 2013 16:43:36 +0000 (12:43 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 9 May 2013 16:43:36 +0000 (12:43 -0400)
commit0138d6b24ff942e4ccd54e52c0dc619d6911c452
tree0ff2545c076f920080c2715f42b04536c9c75c62
parenta3409c0279cf6f6f230c5d163472686867e2f89d
N3639 C++1y VLA support

gcc/
* gimplify.c (gimplify_vla_decl): Don't touch an existing
DECL_VALUE_EXPR.
gcc/cp/
* decl.c (compute_array_index_type): Allow VLAs in C++1y mode.
(check_array_initializer): Allow VLA init.
(reshape_init_array_1): Adjust.
(cp_finish_decl): Check for invalid VLA length.
* typeck2.c (process_init_constructor_array): Adjust.
(store_init_value): Use build_vec_init for VLAs.
* semantics.c (add_capture): Capture VLA as ptr+len.
(vla_capture_type): New.
(build_capture_proxy): Rebuild the VLA.
* typeck.c (build_simple_component_ref): Split out from...
(build_ptrmemfunc_access_expr): ...here.
* tree.c (array_of_runtime_bound_p): New.
* init.c (throw_bad_array_length): New.
(build_vec_init): Use it.
* parser.c (cp_convert_range_for): When iterating over a VLA,
use it directly rather than bind a reference.
* cp-tree.h: Declare new functions.
libstdc++-v3/
* libsupc++/new: Add std::bad_array_length.
* libsupc++/bad_array_length.cc: New.
* libsupc++/eh_aux_runtime.cc: Add __cxa_bad_array_length.
* libsupc++/Makefile.in: Build them.
* config/abi/pre/gnu.ver: Add new symbols.
* config/abi/pre/gnu-versioned-namespace.ver: Add new symbols.

From-SVN: r198745
23 files changed:
gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/init.c
gcc/cp/parser.c
gcc/cp/semantics.c
gcc/cp/tree.c
gcc/cp/typeck.c
gcc/cp/typeck2.c
gcc/gimplify.c
gcc/testsuite/g++.dg/cpp1y/vla2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1y/vla3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1y/vla4.C [new file with mode: 0644]
gcc/testsuite/g++.dg/init/array24.C
libstdc++-v3/ChangeLog
libstdc++-v3/config/abi/pre/gnu-versioned-namespace.ver
libstdc++-v3/config/abi/pre/gnu.ver
libstdc++-v3/libsupc++/Makefile.in
libstdc++-v3/libsupc++/bad_array_length.cc [new file with mode: 0644]
libstdc++-v3/libsupc++/cxxabi.h
libstdc++-v3/libsupc++/eh_aux_runtime.cc
libstdc++-v3/libsupc++/new