commit cb8271fe1b49b984fa38dc6cf1d3ed25462afd20
Author: Jason Merrill <jason@redhat.com>
Date: Sun Oct 18 10:15:36 2015 -1000
* c-cppbuiltin.c (c_cpp_builtins): Define
__cpp_enumerator_attributes, __cpp_fold_expressions,
__cpp_unicode_characters.
@@ -833,7 +833,8 @@ c_cpp_builtins (cpp_reader *pfile)
if (cxx_dialect >= cxx11)
{
/* Set feature test macros for C++11. */
- cpp_define (pfile, "__cpp_unicode_characters=200704");
+ if (cxx_dialect <= cxx14)
+ cpp_define (pfile, "__cpp_unicode_characters=200704");
cpp_define (pfile, "__cpp_raw_strings=200710");
cpp_define (pfile, "__cpp_unicode_literals=200710");
cpp_define (pfile, "__cpp_user_defined_literals=200809");
@@ -869,9 +870,12 @@ c_cpp_builtins (cpp_reader *pfile)
if (cxx_dialect > cxx14)
{
/* Set feature test macros for C++1z. */
+ cpp_define (pfile, "__cpp_unicode_characters=201411");
cpp_define (pfile, "__cpp_static_assert=201411");
cpp_define (pfile, "__cpp_namespace_attributes=201411");
+ cpp_define (pfile, "__cpp_enumerator_attributes=201411");
cpp_define (pfile, "__cpp_nested_namespace_definitions=201411");
+ cpp_define (pfile, "__cpp_fold_expressions=201411");
}
if (flag_concepts)
/* Use a value smaller than the 201507 specified in
new file mode 100644
@@ -0,0 +1,9 @@
+// { dg-options "-std=c++1z" }
+
+#ifndef __cpp_enumerator_attributes
+#error __cpp_enumerator_attributes not defined
+#endif
+
+#if __cpp_enumerator_attributes != 201411
+#error Wrong value for __cpp_enumerator_attributes
+#endif
new file mode 100644
@@ -0,0 +1,5 @@
+// This macro should not be defined without -std=c++1z.
+
+#ifdef __cpp_enumerator_attributes
+#error __cpp_enumerator_attributes defined
+#endif
new file mode 100644
@@ -0,0 +1,9 @@
+// { dg-options "-std=c++1z" }
+
+#ifndef __cpp_fold_expressions
+#error __cpp_fold_expressions not defined
+#endif
+
+#if __cpp_fold_expressions != 201411
+#error Wrong value for __cpp_fold_expressions
+#endif
new file mode 100644
@@ -0,0 +1,5 @@
+// This macro should not be defined without -std=c++1z.
+
+#ifdef __cpp_fold_expressions
+#error __cpp_fold_expressions defined
+#endif
new file mode 100644
@@ -0,0 +1,9 @@
+// { dg-options "-std=c++1z" }
+
+#ifndef __cpp_unicode_characters
+#error __cpp_unicode_characters not defined
+#endif
+
+#if __cpp_unicode_characters != 201411
+#error Wrong value for __cpp_unicode_characters
+#endif
new file mode 100644
@@ -0,0 +1,5 @@
+// This macro should not be 201411 without -std=c++1z.
+
+#if __cpp_unicode_characters == 201411
+#error Wrong value for __cpp_unicode_characters
+#endif