aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/format-strings-0x.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-06-13 05:37:23 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-06-13 05:37:23 +0000
commitdf9ef1bc8c3780307ab2ed81bf5e31c23310b936 (patch)
tree9e20cf7f68ca359286d114d7dad9fccebb002253 /test/SemaCXX/format-strings-0x.cpp
parent3cc509b5ac0e99ef44c1bf8b57cd403b546abc3d (diff)
PR13099: Teach -Wformat about raw string literals, UTF-8 strings and Unicode escape sequences.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158390 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/format-strings-0x.cpp')
-rw-r--r--test/SemaCXX/format-strings-0x.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/SemaCXX/format-strings-0x.cpp b/test/SemaCXX/format-strings-0x.cpp
index e7c5904c66..7b3aef1ee5 100644
--- a/test/SemaCXX/format-strings-0x.cpp
+++ b/test/SemaCXX/format-strings-0x.cpp
@@ -12,4 +12,16 @@ void f(char **sp, float *fp) {
scanf("%afoobar", fp);
printf(nullptr);
printf(*sp); // expected-warning {{not a string literal}}
+
+ // PR13099
+ printf(
+ R"foobar(%)foobar"
+ R"bazquux(d)bazquux" // expected-warning {{more '%' conversions than data arguments}}
+ R"xyzzy()xyzzy");
+
+ printf(u8"this is %d test", 0); // ok
+ printf(u8R"foo(
+ \u1234\U0010fffe
+ %d)foo" // expected-warning {{more '%' conversions than data arguments}}
+ );
}