]> granicus.if.org Git - clang/commitdiff
Add a query macro for C++11 N3276, decltype does not require complete
authorDouglas Gregor <dgregor@apple.com>
Tue, 10 Apr 2012 20:00:33 +0000 (20:00 +0000)
committerDouglas Gregor <dgregor@apple.com>
Tue, 10 Apr 2012 20:00:33 +0000 (20:00 +0000)
return types, from Michel Morin!

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

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

index 40145a4739632b23b17ca1de677bab472ab8f4d8..9da30b9c0d91310883d0d1ab8cf20a006847edf4 100644 (file)
@@ -767,7 +767,11 @@ enabled.</p>
 
 <p>Use <tt>__has_feature(cxx_decltype)</tt> or
 <tt>__has_extension(cxx_decltype)</tt> to determine if support for the
-<tt>decltype()</tt> specifier is enabled.</p>
+<tt>decltype()</tt> specifier is enabled. C++11's <tt>decltype</tt>
+does not require type-completeness of a function call expression.
+Use <tt>__has_feature(cxx_decltype_incomplete_return_types)</tt>
+or <tt>__has_extension(cxx_decltype_incomplete_return_types)</tt>
+to determine if support for this feature is enabled.</p>
 
 <h4 id="cxx_default_function_template_args">C++11 default template arguments in function templates</h4>
 
index 295e9d05a629d77f60e23a3d5a4aab087c72663f..fe7058570efae8197c805c29488b6a922948d61a 100644 (file)
@@ -649,6 +649,7 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) {
            .Case("cxx_auto_type", LangOpts.CPlusPlus0x)
            .Case("cxx_constexpr", LangOpts.CPlusPlus0x)
            .Case("cxx_decltype", LangOpts.CPlusPlus0x)
+           .Case("cxx_decltype_incomplete_return_types", LangOpts.CPlusPlus0x)
            .Case("cxx_default_function_template_args", LangOpts.CPlusPlus0x)
            .Case("cxx_defaulted_functions", LangOpts.CPlusPlus0x)
            .Case("cxx_delegating_constructors", LangOpts.CPlusPlus0x)
index 30e150bcb64d1e45cacd9a9df0a977b1ffa68d9a..8e0222dcecd59b58395ddb0dedc7ffd49644b141 100644 (file)
@@ -40,6 +40,16 @@ int no_decltype();
 // CHECK-NO-0X: no_decltype
 
 
+#if __has_feature(cxx_decltype_incomplete_return_types)
+int has_decltype_incomplete_return_types();
+#else
+int no_decltype_incomplete_return_types();
+#endif
+
+// CHECK-0X: has_decltype_incomplete_return_types
+// CHECK-NO-0X: no_decltype_incomplete_return_types
+
+
 #if __has_feature(cxx_auto_type)
 int has_auto_type();
 #else
index 8305b73ec65213a7315a85c357032e65cc37fef6..439044af76843738347d0fed1ce3b033d13d9d2e 100644 (file)
@@ -119,6 +119,11 @@ with clang; other versions have not been tested.</p>
       <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf">N2343</a></td>
       <td class="full" align="center">Clang 2.9</td>
     </tr>
+    <tr>
+      <td>&nbsp;&nbsp;&nbsp;&nbsp;Incomplete return types</td>
+      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3276.pdf">N3276</a></td>
+      <td class="svn" align="center">SVN</td>
+    </tr>
     <tr>
       <td>Right angle brackets</td>
       <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html">N1757</a></td>