diff options
-rw-r--r-- | docs/LanguageExtensions.html | 7 | ||||
-rw-r--r-- | lib/Lex/PPMacroExpansion.cpp | 2 | ||||
-rw-r--r-- | test/Lexer/has_extension_cxx.cpp | 8 | ||||
-rw-r--r-- | test/Lexer/has_feature_cxx0x.cpp | 9 |
4 files changed, 26 insertions, 0 deletions
diff --git a/docs/LanguageExtensions.html b/docs/LanguageExtensions.html index af0d328f68..d6053b90fb 100644 --- a/docs/LanguageExtensions.html +++ b/docs/LanguageExtensions.html @@ -57,6 +57,7 @@ <li><a href="#cxx_inheriting_constructors">C++11 inheriting constructors</a></li> <li><a href="#cxx_inline_namespaces">C++11 inline namespaces</a></li> <li><a href="#cxx_lambdas">C++11 lambdas</a></li> + <li><a href="#cxx_local_type_template_args">C++11 local and unnamed types as template arguments</a></li> <li><a href="#cxx_noexcept">C++11 noexcept specification</a></li> <li><a href="#cxx_nonstatic_member_init">C++11 in-class non-static data member initialization</a></li> <li><a href="#cxx_nullptr">C++11 nullptr</a></li> @@ -792,6 +793,12 @@ inline namespaces is enabled.</p> <tt>__has_extension(cxx_lambdas)</tt> to determine if support for lambdas is enabled. </p> +<h4 id="cxx_local_type_template_args">C++11 local and unnamed types as template arguments</h4> + +<p>Use <tt>__has_feature(cxx_local_type_template_args)</tt> or +<tt>__has_extension(cxx_local_type_template_args)</tt> to determine if +support for local and unnamed types as template arguments is enabled.</p> + <h4 id="cxx_noexcept">C++11 noexcept</h4> <p>Use <tt>__has_feature(cxx_noexcept)</tt> or diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp index bc04bc95a7..295e9d05a6 100644 --- a/lib/Lex/PPMacroExpansion.cpp +++ b/lib/Lex/PPMacroExpansion.cpp @@ -659,6 +659,7 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) { //.Case("cxx_inheriting_constructors", false) .Case("cxx_inline_namespaces", LangOpts.CPlusPlus0x) .Case("cxx_lambdas", LangOpts.CPlusPlus0x) + .Case("cxx_local_type_template_args", LangOpts.CPlusPlus0x) .Case("cxx_nonstatic_member_init", LangOpts.CPlusPlus0x) .Case("cxx_noexcept", LangOpts.CPlusPlus0x) .Case("cxx_nullptr", LangOpts.CPlusPlus0x) @@ -753,6 +754,7 @@ static bool HasExtension(const Preprocessor &PP, const IdentifierInfo *II) { .Case("cxx_deleted_functions", LangOpts.CPlusPlus) .Case("cxx_explicit_conversions", LangOpts.CPlusPlus) .Case("cxx_inline_namespaces", LangOpts.CPlusPlus) + .Case("cxx_local_type_template_args", LangOpts.CPlusPlus) .Case("cxx_nonstatic_member_init", LangOpts.CPlusPlus) .Case("cxx_override_control", LangOpts.CPlusPlus) .Case("cxx_range_for", LangOpts.CPlusPlus) diff --git a/test/Lexer/has_extension_cxx.cpp b/test/Lexer/has_extension_cxx.cpp index 5481b596cc..6ffeebda1f 100644 --- a/test/Lexer/has_extension_cxx.cpp +++ b/test/Lexer/has_extension_cxx.cpp @@ -39,3 +39,11 @@ int has_reference_qualified_functions(); #if __has_extension(cxx_rvalue_references) int has_rvalue_references(); #endif + +#if __has_extension(cxx_local_type_template_args) +int has_local_type_template_args(); +#else +int no_local_type_template_args(); +#endif + +// CHECK: has_local_type_template_args diff --git a/test/Lexer/has_feature_cxx0x.cpp b/test/Lexer/has_feature_cxx0x.cpp index 1c045664ce..30e150bcb6 100644 --- a/test/Lexer/has_feature_cxx0x.cpp +++ b/test/Lexer/has_feature_cxx0x.cpp @@ -253,3 +253,12 @@ int no_user_literals(); // CHECK-0X: has_user_literals // CHECK-NO-0X: no_user_literals + +#if __has_feature(cxx_local_type_template_args) +int has_local_type_template_args(); +#else +int no_local_type_template_args(); +#endif + +// CHECK-0X: has_local_type_template_args +// CHECK-NO-0X: no_local_type_template_args |