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.
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");
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");
# 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
# 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