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

Douglas Gregor dgregor at apple.com
Sat Feb 5 12:35:30 PST 2011


Author: dgregor
Date: Sat Feb  5 14:35:30 2011
New Revision: 124973

URL: http://llvm.org/viewvc/llvm-project?rev=124973&view=rev
Log:
Add a __has_feature check for default template arguments in function
templates, a C++0x feature.

Modified:
    cfe/trunk/docs/LanguageExtensions.html
    cfe/trunk/lib/Lex/PPMacroExpansion.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=124973&r1=124972&r2=124973&view=diff
==============================================================================
--- cfe/trunk/docs/LanguageExtensions.html (original)
+++ cfe/trunk/docs/LanguageExtensions.html Sat Feb  5 14:35:30 2011
@@ -34,6 +34,7 @@
   <ul>
   <li><a href="#cxx_attributes">C++0x attributes</a></li>
   <li><a href="#cxx_decltype">C++0x <tt>decltype()</tt></a></li>
+  <li><a href="#cxx_default_function_template_args">C++0x default template arguments in function templates</a></li>
   <li><a href="#cxx_deleted_functions">C++0x deleted functions</a></li>
   <li><a href="#cxx_lambdas">C++0x lambdas</a></li>
   <li><a href="#cxx_nullptr">C++0x nullptr</a></li>
@@ -381,6 +382,10 @@
 <p>Use <tt>__has_feature(cxx_attributes)</tt> to determine if support for
 attribute parsing with C++0x's square bracket notation is enabled.</p>
 
+<h3 id="cxx_default_function_template_args">C++0x default template arguments in function templates</h3>
+
+<p>Use <tt>__has_feature(cxx_default_function_template_args)</tt> to determine if support for default template arguments in function templates is enabled.</p>
+
 <h3 id="cxx_deleted_functions">C++0x deleted functions</tt></h3>
 
 <p>Use <tt>__has_feature(cxx_deleted_functions)</tt> to determine if support for

Modified: cfe/trunk/lib/Lex/PPMacroExpansion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPMacroExpansion.cpp?rev=124973&r1=124972&r2=124973&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPMacroExpansion.cpp (original)
+++ cfe/trunk/lib/Lex/PPMacroExpansion.cpp Sat Feb  5 14:35:30 2011
@@ -555,6 +555,7 @@
            .Case("cxx_attributes", LangOpts.CPlusPlus0x)
          //.Case("cxx_auto_type", false)
            .Case("cxx_decltype", LangOpts.CPlusPlus0x)
+           .Case("cxx_default_function_template_args", LangOpts.CPlusPlus0x)
            .Case("cxx_deleted_functions", LangOpts.CPlusPlus0x)
            .Case("cxx_inline_namespaces", LangOpts.CPlusPlus0x)
          //.Case("cxx_lambdas", false)

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=124973&r1=124972&r2=124973&view=diff
==============================================================================
--- cfe/trunk/test/Lexer/has_feature_cxx0x.cpp (original)
+++ cfe/trunk/test/Lexer/has_feature_cxx0x.cpp Sat Feb  5 14:35:30 2011
@@ -109,3 +109,12 @@
 // CHECK-0X: has_reference_qualified_functions
 // CHECK-NO-0X: no_reference_qualified_functions
 
+#if __has_feature(cxx_default_function_template_args)
+int has_default_function_template_args();
+#else
+int no_default_function_template_args();
+#endif
+
+// CHECK-0X: has_default_function_template_args
+// CHECK-NO-0X: no_default_function_template_args
+





More information about the cfe-commits mailing list