summaryrefslogtreecommitdiffstats
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index b402b5c4a5..fb14a6b7c1 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -11053,6 +11053,20 @@ TEST_F(FormatTest, AllignTrailingComments) {
"/* comment 3 */ \\\n",
getLLVMStyleWithColumns(40)));
}
+
+TEST_F(FormatTest, UTF8CharacterLiteralCpp03) {
+ format::FormatStyle Style = format::getLLVMStyle();
+ Style.Standard = FormatStyle::LS_Cpp03;
+ // cpp03 recognize this string as identifier u8 and literal character 'a'
+ EXPECT_EQ("auto c = u8 'a';", format("auto c = u8'a';", Style));
+}
+
+TEST_F(FormatTest, UTF8CharacterLiteralCpp11) {
+ // u8'a' is a C++17 feature, utf8 literal character, LS_Cpp11 covers
+ // all modes, including C++11, C++14 and C++17
+ EXPECT_EQ("auto c = u8'a';", format("auto c = u8'a';"));
+}
+
} // end namespace
} // end namespace format
} // end namespace clang