From: Sebastian Redl
Use __has_feature(cxx_trailing_return) to determine if support for the alternate function declaration syntax with trailing return type is enabled.
+Use __has_feature(cxx_noexcept) to determine if support for +noexcept exception specifications is enabled.
+Use __has_feature(cxx_strong_enums) to determine if support for diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp index 10abfb4b83..858090acb8 100644 --- a/lib/Lex/PPMacroExpansion.cpp +++ b/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/test/Lexer/has_feature_cxx0x.cpp b/test/Lexer/has_feature_cxx0x.cpp index 07a3ebd38d..ff0e85d33a 100644 --- a/test/Lexer/has_feature_cxx0x.cpp +++ b/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 +