]> gcc.gnu.org Git - gcc.git/commitdiff
* c-cppbuiltin.c (c_cpp_builtins): Enable C++14 __cpp_constexpr.
authorJason Merrill <jason@redhat.com>
Fri, 12 Dec 2014 03:49:19 +0000 (22:49 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 12 Dec 2014 03:49:19 +0000 (22:49 -0500)
From-SVN: r218656

gcc/c-family/ChangeLog
gcc/c-family/c-cppbuiltin.c
gcc/testsuite/g++.dg/cpp1y/feat-cxx14.C

index db08d185e08c0bd1e0cd67e0f16f3a294184050e..f064370cc783ef4a507710ef658f423601ea96ea 100644 (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.
 
index 54d3acd85479dc768b5027d0780c1578e979c6e1..2dfecb659d9981dd659e4f2fbf486b65612ff468 100644 (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");
index d271752ec10c06ae43e39be99bb0697aa0a33097..36e11354fb77a1c1aab145accdd6dbebd6ef7543 100644 (file)
 #  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
This page took 0.075216 seconds and 5 git commands to generate.