From: Anders Carlsson Date: Fri, 25 Mar 2011 15:04:23 +0000 (+0000) Subject: we can now claim to fully support the override control feature in C++0x. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c8b9f7977094d0169ec59f9042e85ca854735299;p=clang we can now claim to fully support the override control feature in C++0x. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128281 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/docs/LanguageExtensions.html b/docs/LanguageExtensions.html index 30aa0e121e..1cd77a1791 100644 --- a/docs/LanguageExtensions.html +++ b/docs/LanguageExtensions.html @@ -38,6 +38,7 @@ td {
  • C++0x deleted functions
  • C++0x lambdas
  • C++0x nullptr
  • +
  • C++0x override control
  • C++0x rvalue references
  • C++0x reference-qualified functions
  • C++0x static_assert()
  • @@ -399,6 +400,11 @@ lambdas is enabled. clang does not currently implement this feature.

    nullptr is enabled. clang does not yet fully implement this feature.

    +

    C++0x override control

    + +

    Use __has_feature(cxx_override_control) to determine if support for +the override control keywords is enabled.

    +

    C++0x reference-qualified functions

    Use __has_feature(cxx_reference_qualified_functions) to determine if support for reference-qualified functions (e.g., member functions with & or && applied to *this) is enabled.

    diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp index 62d3dba5cc..e1fc0ba88f 100644 --- a/lib/Lex/PPMacroExpansion.cpp +++ b/lib/Lex/PPMacroExpansion.cpp @@ -562,6 +562,7 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) { //.Case("cxx_lambdas", false) .Case("cxx_noexcept", LangOpts.CPlusPlus0x) //.Case("cxx_nullptr", false) + .Case("cxx_override_control", LangOpts.CPlusPlus0x) .Case("cxx_reference_qualified_functions", LangOpts.CPlusPlus0x) .Case("cxx_rvalue_references", LangOpts.CPlusPlus0x) .Case("cxx_strong_enums", LangOpts.CPlusPlus0x) diff --git a/test/Lexer/has_feature_cxx0x.cpp b/test/Lexer/has_feature_cxx0x.cpp index ff0e85d33a..93e8782bcd 100644 --- a/test/Lexer/has_feature_cxx0x.cpp +++ b/test/Lexer/has_feature_cxx0x.cpp @@ -126,3 +126,11 @@ int no_noexcept(); // CHECK-0X: has_noexcept // CHECK-NO-0X: no_noexcept +#if __has_feature(cxx_override_control) +int has_override_control(); +#else +int no_override_control(); +#endif + +// CHECK-0X: has_override_control +// CHECK-NO-0X: no_override_control