+2015-10-19 Jason Merrill <jason@redhat.com>
+
+ * c-cppbuiltin.c (c_cpp_builtins): Define
+ __cpp_enumerator_attributes, __cpp_fold_expressions,
+ __cpp_unicode_characters.
+
2015-10-13 Jakub Jelinek <jakub@redhat.com>
Aldy Hernandez <aldyh@redhat.com>
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");
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
--- /dev/null
+// { 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
--- /dev/null
+// This macro should not be defined without -std=c++1z.
+
+#ifdef __cpp_enumerator_attributes
+#error __cpp_enumerator_attributes defined
+#endif
--- /dev/null
+// { 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
--- /dev/null
+// This macro should not be defined without -std=c++1z.
+
+#ifdef __cpp_fold_expressions
+#error __cpp_fold_expressions defined
+#endif
--- /dev/null
+// { 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
--- /dev/null
+// This macro should not be 201411 without -std=c++1z.
+
+#if __cpp_unicode_characters == 201411
+#error Wrong value for __cpp_unicode_characters
+#endif