diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-06-13 05:37:23 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-06-13 05:37:23 +0000 |
commit | 4060f774625d4539f4143993fe7ca990a5de512a (patch) | |
tree | 84d688e56593d6ffb99e7db6c080cd3442feae9d /clang/test/SemaCXX/format-strings-0x.cpp | |
parent | 1c66b87f7d83d8be04fec5e85e0b3662621810c8 (diff) | |
download | bcm5719-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/SemaCXX/format-strings-0x.cpp')
-rw-r--r-- | clang/test/SemaCXX/format-strings-0x.cpp | 12 |
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}} + ); } |