summaryrefslogtreecommitdiff
path: root/gcc/c-family/c-cppbuiltin.c
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2015-08-18 14:38:51 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2015-08-18 14:38:51 +0000
commita03a71ab482757655d860ce39aeea6fc2aa121a9 (patch)
tree90e6b9dd5e6bcbeae6d2e922632eb8e97aae42e0 /gcc/c-family/c-cppbuiltin.c
parent6189000cabdd662f824c8360c1eaad5e93534747 (diff)
downloadgcc-a03a71ab482757655d860ce39aeea6fc2aa121a9.tar.gz
c-family/
2015-08-18 Paolo Carlini <paolo.carlini@oracle.com> PR c++/67160 * c-cppbuiltin.c (c_cpp_builtins): Fix __cpp_static_assert value in c++1z mode. testsuite/ 2015-08-18 Paolo Carlini <paolo.carlini@oracle.com> PR c++/67160 * g++.dg/cpp1z/feat-cxx1z.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@226972 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family/c-cppbuiltin.c')
-rw-r--r--gcc/c-family/c-cppbuiltin.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c
index 6e18a77f227..0e45a576e9b 100644
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -832,7 +832,7 @@ c_cpp_builtins (cpp_reader *pfile)
if (cxx_dialect >= cxx11)
{
- /* Set feature test macros for C++11 */
+ /* Set feature test macros for C++11. */
cpp_define (pfile, "__cpp_unicode_characters=200704");
cpp_define (pfile, "__cpp_raw_strings=200710");
cpp_define (pfile, "__cpp_unicode_literals=200710");
@@ -841,7 +841,8 @@ c_cpp_builtins (cpp_reader *pfile)
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");
+ if (cxx_dialect <= cxx14)
+ cpp_define (pfile, "__cpp_static_assert=200410");
cpp_define (pfile, "__cpp_decltype=200707");
cpp_define (pfile, "__cpp_attributes=200809");
cpp_define (pfile, "__cpp_rvalue_reference=200610");
@@ -855,7 +856,7 @@ c_cpp_builtins (cpp_reader *pfile)
}
if (cxx_dialect > cxx11)
{
- /* Set feature test macros for C++14 */
+ /* Set feature test macros for C++14. */
cpp_define (pfile, "__cpp_return_type_deduction=201304");
cpp_define (pfile, "__cpp_init_captures=201304");
cpp_define (pfile, "__cpp_generic_lambdas=201304");
@@ -865,6 +866,11 @@ c_cpp_builtins (cpp_reader *pfile)
cpp_define (pfile, "__cpp_variable_templates=201304");
cpp_define (pfile, "__cpp_digit_separators=201309");
}
+ if (cxx_dialect > cxx14)
+ {
+ /* Set feature test macros for C++1z. */
+ cpp_define (pfile, "__cpp_static_assert=201411");
+ }
if (flag_concepts)
/* Use a value smaller than the 201507 specified in
the TS, since we don't yet support extended auto. */