summaryrefslogtreecommitdiffstats
path: root/clang/test
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
commit4060f774625d4539f4143993fe7ca990a5de512a (patch)
tree84d688e56593d6ffb99e7db6c080cd3442feae9d /clang/test
parent1c66b87f7d83d8be04fec5e85e0b3662621810c8 (diff)
downloadbcm5719-llvm-4060f774625d4539f4143993fe7ca990a5de512a.tar.gz
bcm5719-llvm-4060f774625d4539f4143993fe7ca990a5de512a.zip
PR13099: Teach -Wformat about raw string literals, UTF-8 strings and Unicode escape sequences.
llvm-svn: 158390
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaCXX/format-strings-0x.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/format-strings-0x.cpp b/clang/test/SemaCXX/format-strings-0x.cpp
index e7c5904c66e..7b3aef1ee5d 100644
--- a/clang/test/SemaCXX/format-strings-0x.cpp
+++ b/clang/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}}
+ );
}
OpenPOWER on IntegriCloud