diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-03-08 23:06:02 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-03-08 23:06:02 +0000 |
commit | 33762775706e81c17ca774102ceda36049ecc593 (patch) | |
tree | 6a4c41f4294bf4771264e733d061404ed75e7a8c /test/FixIt | |
parent | 1e5bc4ffb2db5b575fb28d7ebffb6bb36b034162 (diff) |
Fix a couple of issues with literal-operator-id parsing, and provide recovery
for a few kinds of error. Specifically:
Since we're after translation phase 6, the "" token might be formed by multiple
source-level string literals. Checking the token width is not a correct way of
detecting empty string literals, due to escaped newlines. Diagnose and recover
from a missing space between "" and suffix, and from string literals other than
"", which are followed by a suffix.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152348 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/FixIt')
-rw-r--r-- | test/FixIt/fixit-cxx0x.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/FixIt/fixit-cxx0x.cpp b/test/FixIt/fixit-cxx0x.cpp index 2bf9b20326..dcd9f74a10 100644 --- a/test/FixIt/fixit-cxx0x.cpp +++ b/test/FixIt/fixit-cxx0x.cpp @@ -65,3 +65,15 @@ void S2::f(int i) { const char *p = "foo"bar; // expected-error {{requires a space between}} #define ord - '0' int k = '4'ord; // expected-error {{requires a space between}} + +void operator""_x(char); // expected-error {{requires a space}} +void operator"x" _y(char); // expected-error {{must be '""'}} +void operator L"" _z(char); // expected-error {{encoding prefix}} +void operator "x" "y" U"z" ""_whoops "z" "y"(char); // expected-error {{must be '""'}} + +void f() { + 'a'_x; + 'b'_y; + 'c'_z; + 'd'_whoops; +} |