]> granicus.if.org Git - clang/commitdiff
Add a __has_feature check for default template arguments in function
authorDouglas Gregor <dgregor@apple.com>
Sat, 5 Feb 2011 20:35:30 +0000 (20:35 +0000)
committerDouglas Gregor <dgregor@apple.com>
Sat, 5 Feb 2011 20:35:30 +0000 (20:35 +0000)
templates, a C++0x feature.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124973 91177308-0d34-0410-b5e6-96231b3b80d8

docs/LanguageExtensions.html
lib/Lex/PPMacroExpansion.cpp
test/Lexer/has_feature_cxx0x.cpp

index 8b6b96f6f28a7251a16fab09a640956dbe729eef..8f412c63653b3579e1171bcac4aff227e5c1e234 100644 (file)
@@ -34,6 +34,7 @@ td {
   <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 @@ not yet implemented will be noted.</p>
 <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
index 4a719cac6c492155cce93af9b2ddce814ef8427c..cc294ee2665c46ef70d1d2f6e88c46d616c38a35 100644 (file)
@@ -555,6 +555,7 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) {
            .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)
index 2944ae374c5497828d27711a7e146f485e17d008..21950148cfecadf9610d6d92a6d07ee312aacfdc 100644 (file)
@@ -109,3 +109,12 @@ int no_reference_qualified_functions();
 // 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
+