* c-cppbuiltin.c (c_cpp_builtins): Define __cpp_if_constexpr.
authorJason Merrill <jason@redhat.com>
Wed, 10 Aug 2016 22:38:34 +0000 (18:38 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 10 Aug 2016 22:38:34 +0000 (18:38 -0400)
From-SVN: r239340

gcc/c-family/ChangeLog
gcc/c-family/c-cppbuiltin.c
gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C

index def4e11401f7c058ccdff8138a465e8c0cd7aaf8..13acd93a17c366a9dc986390031d02a33fec95c5 100644 (file)
@@ -1,3 +1,7 @@
+2016-08-10  Jason Merrill  <jason@redhat.com>
+
+       * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_if_constexpr.
+
 2016-08-09  Jason Merrill  <jason@redhat.com>
 
        * c-common.c (c_common_attribute_table): vector_size affects type
index 46c70ac1150eb80941f24ae56e54bb79ad3e689d..82ed19d1f8d43c4a4774f4b884207511b9fbca49 100644 (file)
@@ -882,6 +882,7 @@ c_cpp_builtins (cpp_reader *pfile)
          cpp_define (pfile, "__cpp_nontype_template_args=201411");
          cpp_define (pfile, "__cpp_range_based_for=201603");
          cpp_define (pfile, "__cpp_constexpr=201603");
+         cpp_define (pfile, "__cpp_if_constexpr=201606");
        }
       if (flag_concepts)
        /* Use a value smaller than the 201507 specified in
index f5ed6ab9cc89eef477a3f90f71930da3072064a5..41b6111453752302db0160fda1f8886f74a91834 100644 (file)
 #  error "__cpp_hex_float != 201603"
 #endif
 
+#ifndef __cpp_if_constexpr
+#  error "__cpp_if_constexpr"
+#elif __cpp_if_constexpr != 201606
+#  error "__cpp_if_constexpr != 201606"
+#endif
+
 #ifdef __has_cpp_attribute
 
 #  if ! __has_cpp_attribute(maybe_unused)