summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2011-03-15 21:17:12 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2011-03-15 21:17:12 +0000
commitc17003c66b43cc0324398d736afe9f0afe8d31a9 (patch)
tree5a1c6525b99cad707fa6da011a1b5f981ac3dfba /clang
parent865f8b592a0aacfd8f6b90fa4f79e660206c81e6 (diff)
downloadbcm5719-llvm-c17003c66b43cc0324398d736afe9f0afe8d31a9.tar.gz
bcm5719-llvm-c17003c66b43cc0324398d736afe9f0afe8d31a9.zip
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. llvm-svn: 127701
Diffstat (limited to 'clang')
-rw-r--r--clang/docs/LanguageExtensions.html6
-rw-r--r--clang/lib/Lex/PPMacroExpansion.cpp1
-rw-r--r--clang/test/Lexer/has_feature_cxx0x.cpp9
3 files changed, 16 insertions, 0 deletions
diff --git a/clang/docs/LanguageExtensions.html b/clang/docs/LanguageExtensions.html
index b0de13a91e9..6bde9817888 100644
--- a/clang/docs/LanguageExtensions.html
+++ b/clang/docs/LanguageExtensions.html
@@ -46,6 +46,7 @@ td {
<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 @@ inline namespaces is enabled.</p>
<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
diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp
index 10abfb4b83d..858090acb84 100644
--- a/clang/lib/Lex/PPMacroExpansion.cpp
+++ b/clang/lib/Lex/PPMacroExpansion.cpp
@@ -560,6 +560,7 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) {
.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)
diff --git a/clang/test/Lexer/has_feature_cxx0x.cpp b/clang/test/Lexer/has_feature_cxx0x.cpp
index 07a3ebd38d3..ff0e85d33ac 100644
--- a/clang/test/Lexer/has_feature_cxx0x.cpp
+++ b/clang/test/Lexer/has_feature_cxx0x.cpp
@@ -117,3 +117,12 @@ int no_default_function_template_args();
// 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
+
OpenPOWER on IntegriCloud