[cfe-commits] r143412 - in /cfe/trunk: lib/Lex/PPMacroExpansion.cpp test/Lexer/has_feature_cxx0x.cpp
Douglas Gregor
dgregor at apple.com
Mon Oct 31 18:23:44 PDT 2011
Author: dgregor
Date: Mon Oct 31 20:23:44 2011
New Revision: 143412
URL: http://llvm.org/viewvc/llvm-project?rev=143412&view=rev
Log:
Add __has_feature(cxx_raw_string_literals) and
__has_feature(cxx_unicode_literals), from Michel Morin!
Modified:
cfe/trunk/lib/Lex/PPMacroExpansion.cpp
cfe/trunk/test/Lexer/has_feature_cxx0x.cpp
Modified: cfe/trunk/lib/Lex/PPMacroExpansion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPMacroExpansion.cpp?rev=143412&r1=143411&r2=143412&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPMacroExpansion.cpp (original)
+++ cfe/trunk/lib/Lex/PPMacroExpansion.cpp Mon Oct 31 20:23:44 2011
@@ -642,13 +642,13 @@
.Case("cxx_nullptr", LangOpts.CPlusPlus0x)
.Case("cxx_override_control", LangOpts.CPlusPlus0x)
.Case("cxx_range_for", LangOpts.CPlusPlus0x)
- //.Case("cxx_raw_string_literals", false)
+ .Case("cxx_raw_string_literals", LangOpts.CPlusPlus0x)
.Case("cxx_reference_qualified_functions", LangOpts.CPlusPlus0x)
.Case("cxx_rvalue_references", LangOpts.CPlusPlus0x)
.Case("cxx_strong_enums", LangOpts.CPlusPlus0x)
.Case("cxx_static_assert", LangOpts.CPlusPlus0x)
.Case("cxx_trailing_return", LangOpts.CPlusPlus0x)
- //.Case("cxx_unicode_literals", false)
+ .Case("cxx_unicode_literals", LangOpts.CPlusPlus0x)
//.Case("cxx_unrestricted_unions", false)
//.Case("cxx_user_literals", false)
.Case("cxx_variadic_templates", LangOpts.CPlusPlus0x)
Modified: cfe/trunk/test/Lexer/has_feature_cxx0x.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Lexer/has_feature_cxx0x.cpp?rev=143412&r1=143411&r2=143412&view=diff
==============================================================================
--- cfe/trunk/test/Lexer/has_feature_cxx0x.cpp (original)
+++ cfe/trunk/test/Lexer/has_feature_cxx0x.cpp Mon Oct 31 20:23:44 2011
@@ -190,3 +190,21 @@
// CHECK-0X: has_alignas
// CHECK-NO-0X: no_alignas
+
+#if __has_feature(cxx_raw_string_literals)
+int has_raw_string_literals();
+#else
+int no_raw_string_literals();
+#endif
+
+// CHECK-0X: has_raw_string_literals
+// CHECK-NO-0X: no_raw_string_literals
+
+#if __has_feature(cxx_unicode_literals)
+int has_unicode_literals();
+#else
+int no_unicode_literals();
+#endif
+
+// CHECK-0X: has_unicode_literals
+// CHECK-NO-0X: no_unicode_literals
More information about the cfe-commits
mailing list