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

Douglas Gregor dgregor at apple.com
Tue Apr 10 13:00:34 PDT 2012


Author: dgregor
Date: Tue Apr 10 15:00:33 2012
New Revision: 154428

URL: http://llvm.org/viewvc/llvm-project?rev=154428&view=rev
Log:
Add a query macro for C++11 N3276, decltype does not require complete
return types, from Michel Morin!

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

Modified: cfe/trunk/docs/LanguageExtensions.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/LanguageExtensions.html?rev=154428&r1=154427&r2=154428&view=diff
==============================================================================
--- cfe/trunk/docs/LanguageExtensions.html (original)
+++ cfe/trunk/docs/LanguageExtensions.html Tue Apr 10 15:00:33 2012
@@ -767,7 +767,11 @@
 
 <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>
 

Modified: cfe/trunk/lib/Lex/PPMacroExpansion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPMacroExpansion.cpp?rev=154428&r1=154427&r2=154428&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPMacroExpansion.cpp (original)
+++ cfe/trunk/lib/Lex/PPMacroExpansion.cpp Tue Apr 10 15:00:33 2012
@@ -649,6 +649,7 @@
            .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)

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=154428&r1=154427&r2=154428&view=diff
==============================================================================
--- cfe/trunk/test/Lexer/has_feature_cxx0x.cpp (original)
+++ cfe/trunk/test/Lexer/has_feature_cxx0x.cpp Tue Apr 10 15:00:33 2012
@@ -40,6 +40,16 @@
 // 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

Modified: cfe/trunk/www/cxx_status.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/www/cxx_status.html?rev=154428&r1=154427&r2=154428&view=diff
==============================================================================
--- cfe/trunk/www/cxx_status.html (original)
+++ cfe/trunk/www/cxx_status.html Tue Apr 10 15:00:33 2012
@@ -120,6 +120,11 @@
       <td class="full" align="center">Clang 2.9</td>
     </tr>
     <tr>
+      <td>    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>
       <td class="full" align="center">Clang 2.9</td>





More information about the cfe-commits mailing list