[cfe-commits] r153983 - in /cfe/trunk: docs/LanguageExtensions.html lib/Lex/PPMacroExpansion.cpp test/Lexer/has_extension_cxx.cpp test/Lexer/has_feature_cxx0x.cpp

Douglas Gregor dgregor at apple.com
Tue Apr 3 17:48:39 PDT 2012


Author: dgregor
Date: Tue Apr  3 19:48:39 2012
New Revision: 153983

URL: http://llvm.org/viewvc/llvm-project?rev=153983&view=rev
Log:
Add feature check "cxx_local_type_template_args" describing support
for templates with local template arguments, from Michel Morin! Fixes
PR12337.

Modified:
    cfe/trunk/docs/LanguageExtensions.html
    cfe/trunk/lib/Lex/PPMacroExpansion.cpp
    cfe/trunk/test/Lexer/has_extension_cxx.cpp
    cfe/trunk/test/Lexer/has_feature_cxx0x.cpp

Modified: cfe/trunk/docs/LanguageExtensions.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/LanguageExtensions.html?rev=153983&r1=153982&r2=153983&view=diff
==============================================================================
--- cfe/trunk/docs/LanguageExtensions.html (original)
+++ cfe/trunk/docs/LanguageExtensions.html Tue Apr  3 19:48:39 2012
@@ -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 @@
 <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

Modified: cfe/trunk/lib/Lex/PPMacroExpansion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPMacroExpansion.cpp?rev=153983&r1=153982&r2=153983&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPMacroExpansion.cpp (original)
+++ cfe/trunk/lib/Lex/PPMacroExpansion.cpp Tue Apr  3 19:48:39 2012
@@ -659,6 +659,7 @@
          //.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 @@
            .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)

Modified: cfe/trunk/test/Lexer/has_extension_cxx.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Lexer/has_extension_cxx.cpp?rev=153983&r1=153982&r2=153983&view=diff
==============================================================================
--- cfe/trunk/test/Lexer/has_extension_cxx.cpp (original)
+++ cfe/trunk/test/Lexer/has_extension_cxx.cpp Tue Apr  3 19:48:39 2012
@@ -39,3 +39,11 @@
 #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

Modified: cfe/trunk/test/Lexer/has_feature_cxx0x.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Lexer/has_feature_cxx0x.cpp?rev=153983&r1=153982&r2=153983&view=diff
==============================================================================
--- cfe/trunk/test/Lexer/has_feature_cxx0x.cpp (original)
+++ cfe/trunk/test/Lexer/has_feature_cxx0x.cpp Tue Apr  3 19:48:39 2012
@@ -253,3 +253,12 @@
 
 // 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





More information about the cfe-commits mailing list