diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-05-09 16:43:36 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-05-09 16:43:36 +0000 |
commit | b749017fafed446f28d44b6fd3345a5fd39faaf1 (patch) | |
tree | 0ff2545c076f920080c2715f42b04536c9c75c62 /libstdc++-v3/libsupc++/new | |
parent | 4fa680c37ccfb7be51a72e981485df6deefc783c (diff) | |
download | ppe42-gcc-b749017fafed446f28d44b6fd3345a5fd39faaf1.tar.gz ppe42-gcc-b749017fafed446f28d44b6fd3345a5fd39faaf1.zip |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198745 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/libsupc++/new')
-rw-r--r-- | libstdc++-v3/libsupc++/new | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libstdc++-v3/libsupc++/new b/libstdc++-v3/libsupc++/new index 3087502190e..cdf4cab85b9 100644 --- a/libstdc++-v3/libsupc++/new +++ b/libstdc++-v3/libsupc++/new @@ -79,6 +79,23 @@ namespace std }; #endif + // We throw this exception for GNU VLAs of negative length in all C++ + // dialects, so declare it if we aren't in strict conformance mode. +#if __cplusplus > 201103L || !defined(__STRICT_ANSI__) + class bad_array_length : public bad_alloc + { + public: + bad_array_length() throw() { }; + + // This declaration is not useless: + // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118 + virtual ~bad_array_length() throw(); + + // See comment in eh_exception.cc. + virtual const char* what() const throw(); + }; +#endif + struct nothrow_t { }; extern const nothrow_t nothrow; |