From: Jason Merrill Date: Wed, 10 Aug 2016 22:38:34 +0000 (-0400) Subject: * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_if_constexpr. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=452df4a4e62dc8e2ff2ccd0828cde674025fb292;p=gcc.git * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_if_constexpr. From-SVN: r239340 --- diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index def4e11401f..13acd93a17c 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,7 @@ +2016-08-10 Jason Merrill + + * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_if_constexpr. + 2016-08-09 Jason Merrill * c-common.c (c_common_attribute_table): vector_size affects type diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c index 46c70ac1150..82ed19d1f8d 100644 --- a/gcc/c-family/c-cppbuiltin.c +++ b/gcc/c-family/c-cppbuiltin.c @@ -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 diff --git a/gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C b/gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C index f5ed6ab9cc8..41b61114537 100644 --- a/gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C +++ b/gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C @@ -344,6 +344,12 @@ # 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)