* c-cppbuiltin.c (c_cpp_builtins): Enable C++14 __cpp_constexpr.

From-SVN: r218656
This commit is contained in:
Jason Merrill 2014-12-11 22:49:19 -05:00 committed by Jason Merrill
parent 94a073b251
commit acaa5911a2
3 changed files with 7 additions and 12 deletions

View File

@ -1,5 +1,7 @@
2014-12-11 Jason Merrill <jason@redhat.com>
* c-cppbuiltin.c (c_cpp_builtins): Enable C++14 __cpp_constexpr.
* c-cppbuiltin.c (c_cpp_builtins): Define __cpp_runtime_arrays if
we aren't complaining about VLAs.

View File

@ -845,7 +845,8 @@ c_cpp_builtins (cpp_reader *pfile)
cpp_define (pfile, "__cpp_unicode_literals=200710");
cpp_define (pfile, "__cpp_user_defined_literals=200809");
cpp_define (pfile, "__cpp_lambdas=200907");
cpp_define (pfile, "__cpp_constexpr=200704");
if (cxx_dialect == cxx11)
cpp_define (pfile, "__cpp_constexpr=200704");
cpp_define (pfile, "__cpp_range_based_for=200907");
cpp_define (pfile, "__cpp_static_assert=200410");
cpp_define (pfile, "__cpp_decltype=200707");
@ -865,8 +866,7 @@ c_cpp_builtins (cpp_reader *pfile)
cpp_define (pfile, "__cpp_return_type_deduction=201304");
cpp_define (pfile, "__cpp_init_captures=201304");
cpp_define (pfile, "__cpp_generic_lambdas=201304");
//cpp_undef (pfile, "__cpp_constexpr");
//cpp_define (pfile, "__cpp_constexpr=201304");
cpp_define (pfile, "__cpp_constexpr=201304");
cpp_define (pfile, "__cpp_decltype_auto=201304");
cpp_define (pfile, "__cpp_aggregate_nsdmi=201304");
cpp_define (pfile, "__cpp_variable_templates=201304");

View File

@ -47,12 +47,6 @@
# error "__cpp_lambdas != 200907"
#endif
#ifndef __cpp_constexpr
# error "__cpp_constexpr"
#elif __cpp_constexpr != 200704
# error "__cpp_constexpr != 200704"
#endif
#ifndef __cpp_range_based_for
# error "__cpp_range_based_for"
#elif __cpp_range_based_for != 200907
@ -145,11 +139,10 @@
# error "__cpp_generic_lambdas != 201304"
#endif
// TODO: Change 200704 to 201304 when C++14 constexpr goes in.
#ifndef __cpp_constexpr
# error "__cpp_constexpr"
#elif __cpp_constexpr != 200704
# error "__cpp_constexpr != 200704"
#elif __cpp_constexpr != 201304
# error "__cpp_constexpr != 201304"
#endif
#ifndef __cpp_decltype_auto