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

Sebastian Redl sebastian.redl at getdesigned.at
Tue Mar 15 14:17:12 PDT 2011


Author: cornedbee
Date: Tue Mar 15 16:17:12 2011
New Revision: 127701

URL: http://llvm.org/viewvc/llvm-project?rev=127701&view=rev
Log:
Create __has_feature(cxx_noexcept) and mark it as working.
Find out that our C++0x status has only one field for noexcept expression and specification together, and that it was accidentally already marked as fully implemented.
This completes noexcept specification work.

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=127701&r1=127700&r2=127701&view=diff
==============================================================================
--- cfe/trunk/docs/LanguageExtensions.html (original)
+++ cfe/trunk/docs/LanguageExtensions.html Tue Mar 15 16:17:12 2011
@@ -46,6 +46,7 @@
   <li><a href="#cxx_inline_namespaces">C++0x inline namespaces</a></li>
   <li><a href="#cxx_strong_enums">C++0x strongly-typed enumerations</a></li>
   <li><a href="#cxx_trailing_return">C++0x trailing return type</a></li>
+  <li><a href="#cxx_noexcept">C++0x noexcept specification</a></li>
   </ul>
 <li><a href="#checking_type_traits">Checks for Type Traits</a></li>
 <li><a href="#blocks">Blocks</a></li>
@@ -436,6 +437,11 @@
 <p>Use <tt>__has_feature(cxx_trailing_return)</tt> to determine if support for
 the alternate function declaration syntax with trailing return type is enabled.</p>
 
+<h3 id="cxx_noexcept">C++0x noexcept</h3>
+
+<p>Use <tt>__has_feature(cxx_noexcept)</tt> to determine if support for
+noexcept exception specifications is enabled.</p>
+
 <h3 id="cxx_strong_enums">C++0x strongly typed enumerations</h3>
 
 <p>Use <tt>__has_feature(cxx_strong_enums)</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=127701&r1=127700&r2=127701&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPMacroExpansion.cpp (original)
+++ cfe/trunk/lib/Lex/PPMacroExpansion.cpp Tue Mar 15 16:17:12 2011
@@ -560,6 +560,7 @@
            .Case("cxx_deleted_functions", LangOpts.CPlusPlus0x)
            .Case("cxx_inline_namespaces", LangOpts.CPlusPlus0x)
          //.Case("cxx_lambdas", false)
+           .Case("cxx_noexcept", LangOpts.CPlusPlus0x)
          //.Case("cxx_nullptr", false)
            .Case("cxx_reference_qualified_functions", LangOpts.CPlusPlus0x)
            .Case("cxx_rvalue_references", 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=127701&r1=127700&r2=127701&view=diff
==============================================================================
--- cfe/trunk/test/Lexer/has_feature_cxx0x.cpp (original)
+++ cfe/trunk/test/Lexer/has_feature_cxx0x.cpp Tue Mar 15 16:17:12 2011
@@ -117,3 +117,12 @@
 // CHECK-0X: has_default_function_template_args
 // CHECK-NO-0X: no_default_function_template_args
 
+#if __has_feature(cxx_noexcept)
+int has_noexcept();
+#else
+int no_noexcept();
+#endif
+
+// CHECK-0X: has_noexcept
+// CHECK-NO-0X: no_noexcept
+





More information about the cfe-commits mailing list