Add feature check "cxx_local_type_template_args" describing support

for templates with local template arguments, from Michel Morin! Fixes
PR12337.

llvm-svn: 153983
This commit is contained in:
Douglas Gregor 2012-04-04 00:48:39 +00:00
parent 6a37784a35
commit 9781893507
4 changed files with 26 additions and 0 deletions

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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