summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-03-09 08:41:27 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-03-09 08:41:27 +0000
commit5023188315e2cf5091c74cf0d3eec6d358337152 (patch)
tree5c03afb49756996b8633711efa3f3537b91872a1
parentc1b0565a26a4d578f19d0c99253926a255c78573 (diff)
downloadbcm5719-llvm-5023188315e2cf5091c74cf0d3eec6d358337152.tar.gz
bcm5719-llvm-5023188315e2cf5091c74cf0d3eec6d358337152.zip
User-defined literals are done.
llvm-svn: 152396
-rw-r--r--clang/docs/LanguageExtensions.html2
-rw-r--r--clang/lib/Lex/PPMacroExpansion.cpp4
-rw-r--r--clang/test/Lexer/has_feature_cxx0x.cpp9
-rw-r--r--clang/www/cxx_status.html2
4 files changed, 13 insertions, 4 deletions
diff --git a/clang/docs/LanguageExtensions.html b/clang/docs/LanguageExtensions.html
index 12a91c9e6f2..cf61e9d92be 100644
--- a/clang/docs/LanguageExtensions.html
+++ b/clang/docs/LanguageExtensions.html
@@ -819,7 +819,7 @@ support for Unicode string literals is enabled.</p>
<h4 id="cxx_user_literals">C++11 user-defined literals</h4>
-<p>Use <tt>__has_feature(cxx_user_literals)</tt> to determine if support for user-defined literals is enabled. Clang does not currently support this feature.</p>
+<p>Use <tt>__has_feature(cxx_user_literals)</tt> to determine if support for user-defined literals is enabled.</p>
<h4 id="cxx_variadic_templates">C++11 variadic templates</h4>
diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp
index 5f9f1acf73d..26e0ffb5d41 100644
--- a/clang/lib/Lex/PPMacroExpansion.cpp
+++ b/clang/lib/Lex/PPMacroExpansion.cpp
@@ -640,7 +640,7 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) {
.Case("c_atomic", LangOpts.C11)
.Case("c_generic_selections", LangOpts.C11)
.Case("c_static_assert", LangOpts.C11)
- // C++0x features
+ // C++11 features
.Case("cxx_access_control_sfinae", LangOpts.CPlusPlus0x)
.Case("cxx_alias_templates", LangOpts.CPlusPlus0x)
.Case("cxx_alignas", LangOpts.CPlusPlus0x)
@@ -672,7 +672,7 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) {
.Case("cxx_trailing_return", LangOpts.CPlusPlus0x)
.Case("cxx_unicode_literals", LangOpts.CPlusPlus0x)
.Case("cxx_unrestricted_unions", LangOpts.CPlusPlus0x)
- //.Case("cxx_user_literals", false)
+ .Case("cxx_user_literals", LangOpts.CPlusPlus0x)
.Case("cxx_variadic_templates", LangOpts.CPlusPlus0x)
// Type traits
.Case("has_nothrow_assign", LangOpts.CPlusPlus)
diff --git a/clang/test/Lexer/has_feature_cxx0x.cpp b/clang/test/Lexer/has_feature_cxx0x.cpp
index 40d651dff53..1c045664ce6 100644
--- a/clang/test/Lexer/has_feature_cxx0x.cpp
+++ b/clang/test/Lexer/has_feature_cxx0x.cpp
@@ -244,3 +244,12 @@ int no_unrestricted_unions();
// CHECK-0X: has_unrestricted_unions
// CHECK-NO-0X: no_unrestricted_unions
+
+#if __has_feature(cxx_user_literals)
+int has_user_literals();
+#else
+int no_user_literals();
+#endif
+
+// CHECK-0X: has_user_literals
+// CHECK-NO-0X: no_user_literals
diff --git a/clang/www/cxx_status.html b/clang/www/cxx_status.html
index d5405e24c97..fad14f1c0de 100644
--- a/clang/www/cxx_status.html
+++ b/clang/www/cxx_status.html
@@ -213,7 +213,7 @@ with clang; other versions have not been tested.</p>
<tr>
<td>User-defined literals</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf">N2765</a></td>
- <td class="none" align="center">No</td>
+ <td class="svn" align="center">SVN</td>
</tr>
<tr>
<td>Standard Layout Types</td>
OpenPOWER on IntegriCloud