aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2014-12-11 22:49:13 -0500
committerJason Merrill <jason@gcc.gnu.org>2014-12-11 22:49:13 -0500
commit94a073b2515f43d69404f14cd4a66eaa5301c734 (patch)
tree743e5ca8ce9e5b2570cd784c2de90d51c8b44bdd /gcc/c-family
parent8c7e9a616ecd878f0d58f19e65fe7a5b55a2b183 (diff)
downloadgcc-94a073b2515f43d69404f14cd4a66eaa5301c734.zip
gcc-94a073b2515f43d69404f14cd4a66eaa5301c734.tar.gz
gcc-94a073b2515f43d69404f14cd4a66eaa5301c734.tar.bz2
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. From-SVN: r218655
Diffstat (limited to 'gcc/c-family')
-rw-r--r--gcc/c-family/ChangeLog5
-rw-r--r--gcc/c-family/c-cppbuiltin.c12
2 files changed, 14 insertions, 3 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 9cc46d4..db08d18 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,8 @@
+2014-12-11 Jason Merrill <jason@redhat.com>
+
+ * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_runtime_arrays if
+ we aren't complaining about VLAs.
+
2014-12-06 Marek Polacek <polacek@redhat.com>
PR tree-optimization/64183
diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c
index c571d1b..54d3acd 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