]> granicus.if.org Git - clang/commitdiff
User-defined literals are done.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 9 Mar 2012 08:41:27 +0000 (08:41 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 9 Mar 2012 08:41:27 +0000 (08:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152396 91177308-0d34-0410-b5e6-96231b3b80d8

docs/LanguageExtensions.html
lib/Lex/PPMacroExpansion.cpp
test/Lexer/has_feature_cxx0x.cpp
www/cxx_status.html

index 12a91c9e6f2c46f71cd224fedce440d7b854b07a..cf61e9d92bede7c92861a4aa1a9b334a05f0333c 100644 (file)
@@ -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>
 
index 5f9f1acf73df3e1eb473a98e30e370691f5a8722..26e0ffb5d417a839f93e76426bccaf0a5bf5e8df 100644 (file)
@@ -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)
index 40d651dff533144f7e35325f364224d4e1945742..1c045664ce68a31e67dffd42fecbf27e9f05b0a9 100644 (file)
@@ -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
index d5405e24c97fa8471b48f37dc42f29f873a98c96..fad14f1c0de168197aaa0f812de993930ce8d062 100644 (file)
@@ -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>