C++1y: Update __cplusplus to temporary value 201305L to allow detection of provisional C++1y support.
Add __has_feature and __has_extension checks for C++1y features (based on the provisional names from
the C++ features study group), and update documentation to match.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181342 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp
index 1678233..24c6217 100644
--- a/lib/Lex/PPMacroExpansion.cpp
+++ b/lib/Lex/PPMacroExpansion.cpp
@@ -792,6 +792,16 @@
.Case("cxx_unrestricted_unions", LangOpts.CPlusPlus11)
.Case("cxx_user_literals", LangOpts.CPlusPlus11)
.Case("cxx_variadic_templates", LangOpts.CPlusPlus11)
+ // C++1y features
+ .Case("cxx_binary_literals", LangOpts.CPlusPlus1y)
+ //.Case("cxx_contextual_conversions", LangOpts.CPlusPlus1y)
+ //.Case("cxx_generalized_capture", LangOpts.CPlusPlus1y)
+ //.Case("cxx_generic_lambda", LangOpts.CPlusPlus1y)
+ //.Case("cxx_relaxed_constexpr", LangOpts.CPlusPlus1y)
+ //.Case("cxx_return_type_deduction", LangOpts.CPlusPlus1y)
+ //.Case("cxx_runtime_array", LangOpts.CPlusPlus1y)
+ .Case("cxx_aggregate_nsdmi", LangOpts.CPlusPlus1y)
+ //.Case("cxx_variable_templates", LangOpts.CPlusPlus1y)
// Type traits
.Case("has_nothrow_assign", LangOpts.CPlusPlus)
.Case("has_nothrow_copy", LangOpts.CPlusPlus)
@@ -852,7 +862,7 @@
.Case("c_atomic", true)
.Case("c_generic_selections", true)
.Case("c_static_assert", true)
- // C++0x features supported by other languages as extensions.
+ // C++11 features supported by other languages as extensions.
.Case("cxx_atomic", LangOpts.CPlusPlus)
.Case("cxx_deleted_functions", LangOpts.CPlusPlus)
.Case("cxx_explicit_conversions", LangOpts.CPlusPlus)
@@ -863,6 +873,8 @@
.Case("cxx_range_for", LangOpts.CPlusPlus)
.Case("cxx_reference_qualified_functions", LangOpts.CPlusPlus)
.Case("cxx_rvalue_references", LangOpts.CPlusPlus)
+ // C++1y features supported by other languages as extensions.
+ .Case("cxx_binary_literals", true)
.Default(false);
}