summaryrefslogtreecommitdiff
path: root/gcc/c-family/c-cppbuiltin.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2014-12-12 03:49:13 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2014-12-12 03:49:13 +0000
commit4972ed5d6d0679b5f6a2127105d1237f28d07e6a (patch)
tree743e5ca8ce9e5b2570cd784c2de90d51c8b44bdd /gcc/c-family/c-cppbuiltin.c
parentf552994e483367da9ad8c0863fc2d32627925bba (diff)
downloadgcc-4972ed5d6d0679b5f6a2127105d1237f28d07e6a.tar.gz
Remove N3639 "array of runtime length" from -std=c++14.
gcc/cp/ * decl.c (compute_array_index_type): VLAs are not part of C++14. (create_array_type_for_decl, grokdeclarator): Likewise. * lambda.c (add_capture): Likewise. * pt.c (tsubst): Likewise. * rtti.c (get_tinfo_decl): Likewise. * semantics.c (finish_decltype_type): Likewise. * typeck.c (cxx_sizeof_or_alignof_type): Likewise. (cp_build_addr_expr_1): Likewise. * init.c (build_vec_init): Don't throw bad_array_length. gcc/c-family/ * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_runtime_arrays if we aren't complaining about VLAs. libstdc++-v3/ * libsupc++/new (bad_array_length): Move... * bad_array_length.cc: ...here. * cxxabi.h, eh_aux_runtime.cc (__cxa_throw_bad_array_new_length): Also move to bad_array_length.cc. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_runtime_arrays if we aren't complaining about VLAs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218655 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family/c-cppbuiltin.c')
-rw-r--r--gcc/c-family/c-cppbuiltin.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c
index c571d1b2e1e..54d3acd8547 100644
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -828,6 +828,15 @@ c_cpp_builtins (cpp_reader *pfile)
and were standardized for C++14. */
if (!pedantic || cxx_dialect > cxx11)
cpp_define (pfile, "__cpp_binary_literals=201304");
+
+ /* Arrays of runtime bound were removed from C++14, but we still
+ support GNU VLAs. Let's define this macro to a low number
+ (corresponding to the initial test release of GNU C++) if we won't
+ complain about use of VLAs. */
+ if (c_dialect_cxx ()
+ && (pedantic ? warn_vla == 0 : warn_vla <= 0))
+ cpp_define (pfile, "__cpp_runtime_arrays=198712");
+
if (cxx_dialect >= cxx11)
{
/* Set feature test macros for C++11 */
@@ -863,9 +872,6 @@ c_cpp_builtins (cpp_reader *pfile)
cpp_define (pfile, "__cpp_variable_templates=201304");
cpp_define (pfile, "__cpp_digit_separators=201309");
//cpp_define (pfile, "__cpp_sized_deallocation=201309");
- /* We'll have to see where runtime arrays wind up.
- Let's put it in C++14 for now. */
- cpp_define (pfile, "__cpp_runtime_arrays=201304");
}
}
/* Note that we define this for C as well, so that we know if