diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-07-24 17:41:31 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-07-24 17:41:31 +0000 |
| commit | c0f7b81d89e648f1ccaa5609690f20c96248e9c6 (patch) | |
| tree | 0dc988303c04a98c72a980913b4e5c264dd55f86 | |
| parent | f5f726c60d8afb9acf3ef15bf28859dccaf282be (diff) | |
| download | bcm5719-llvm-c0f7b81d89e648f1ccaa5609690f20c96248e9c6.tar.gz bcm5719-llvm-c0f7b81d89e648f1ccaa5609690f20c96248e9c6.zip | |
Update documentation to match current C++1y feature set.
llvm-svn: 187055
| -rw-r--r-- | clang/docs/LanguageExtensions.rst | 4 | ||||
| -rw-r--r-- | clang/lib/Lex/PPMacroExpansion.cpp | 4 | ||||
| -rw-r--r-- | clang/test/Lexer/has_feature_cxx0x.cpp | 20 |
3 files changed, 23 insertions, 5 deletions
diff --git a/clang/docs/LanguageExtensions.rst b/clang/docs/LanguageExtensions.rst index 65840c0c927..229158d369a 100644 --- a/clang/docs/LanguageExtensions.rst +++ b/clang/docs/LanguageExtensions.rst @@ -807,8 +807,7 @@ Use ``__has_feature(cxx_contextual_conversions)`` or ``__has_extension(cxx_contextual_conversions)`` to determine if the C++1y rules are used when performing an implicit conversion for an array bound in a *new-expression*, the operand of a *delete-expression*, an integral constant -expression, or a condition in a ``switch`` statement. Clang does not yet -support this feature. +expression, or a condition in a ``switch`` statement. C++1y decltype(auto) ^^^^^^^^^^^^^^^^^^^^ @@ -849,7 +848,6 @@ Use ``__has_feature(cxx_relaxed_constexpr)`` or ``__has_extension(cxx_relaxed_constexpr)`` to determine if variable declarations, local variable modification, and control flow constructs are permitted in ``constexpr`` functions. -Clang's implementation of this feature is incomplete. C++1y return type deduction ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp index 8dccae1aaa3..4367168fffe 100644 --- a/clang/lib/Lex/PPMacroExpansion.cpp +++ b/clang/lib/Lex/PPMacroExpansion.cpp @@ -974,10 +974,10 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) { .Case("cxx_variadic_templates", LangOpts.CPlusPlus11) // C++1y features .Case("cxx_binary_literals", LangOpts.CPlusPlus1y) - //.Case("cxx_contextual_conversions", LangOpts.CPlusPlus1y) + .Case("cxx_contextual_conversions", LangOpts.CPlusPlus1y) //.Case("cxx_generalized_capture", LangOpts.CPlusPlus1y) //.Case("cxx_generic_lambda", LangOpts.CPlusPlus1y) - //.Case("cxx_relaxed_constexpr", LangOpts.CPlusPlus1y) + .Case("cxx_relaxed_constexpr", LangOpts.CPlusPlus1y) .Case("cxx_return_type_deduction", LangOpts.CPlusPlus1y) //.Case("cxx_runtime_array", LangOpts.CPlusPlus1y) .Case("cxx_aggregate_nsdmi", LangOpts.CPlusPlus1y) diff --git a/clang/test/Lexer/has_feature_cxx0x.cpp b/clang/test/Lexer/has_feature_cxx0x.cpp index 590c168768d..2dc2abe87cf 100644 --- a/clang/test/Lexer/has_feature_cxx0x.cpp +++ b/clang/test/Lexer/has_feature_cxx0x.cpp @@ -356,3 +356,23 @@ int no_return_type_deduction(); // CHECK-1Y: has_return_type_deduction // CHECK-11: no_return_type_deduction // CHECK-NO-11: no_return_type_deduction + +#if __has_feature(cxx_contextual_conversions) +int has_contextual_conversions(); +#else +int no_contextual_conversions(); +#endif + +// CHECK-1Y: has_contextual_conversions +// CHECK-11: no_contextual_conversions +// CHECK-NO-11: no_contextual_conversions + +#if __has_feature(cxx_relaxed_constexpr) +int has_relaxed_constexpr(); +#else +int no_relaxed_constexpr(); +#endif + +// CHECK-1Y: has_relaxed_constexpr +// CHECK-11: no_relaxed_constexpr +// CHECK-NO-11: no_relaxed_constexpr |

