diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-03-06 03:21:47 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-03-06 03:21:47 +0000 |
commit | 99831e4677a7e2e051af636221694d60ba31fcdb (patch) | |
tree | 4684bde38a7659db0c97673dcab98cffce576f9b /test/Lexer/token-concat.cpp | |
parent | c1b0f7fa9b755ab59129ae85187d0d4f91379995 (diff) |
User-defined literals: reject string and character UDLs in all places where the
grammar requires a string-literal and not a user-defined-string-literal. The
two constructs are still represented by the same TokenKind, in order to prevent
a combinatorial explosion of different kinds of token. A flag on Token tracks
whether a ud-suffix is present, in order to prevent clients from needing to look
at the token's spelling.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152098 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Lexer/token-concat.cpp')
-rw-r--r-- | test/Lexer/token-concat.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Lexer/token-concat.cpp b/test/Lexer/token-concat.cpp new file mode 100644 index 0000000000..57dbae03c1 --- /dev/null +++ b/test/Lexer/token-concat.cpp @@ -0,0 +1,19 @@ +// RUN: %clang_cc1 -E -std=c++11 -o - %s | FileCheck %s + +#define id(x) x +id("s")_x // CHECK: "s" _x +id(L"s")_x // CHECK: L"s" _x +id(u8"s")_x // CHECK: u8"s" _x +id(u"s")_x // CHECK: u"s" _x +id(U"s")_x // CHECK: U"s" _x +id('s')_x // CHECK: 's' _x +id(L's')_x // CHECK: L's' _x +id(u's')_x // CHECK: u's' _x +id(U's')_x // CHECK: U's' _x +id("s"_x)_y // CHECK: "s"_x _y +id(1.0_)f // CHECK: 1.0_ f +id(1.0)_f // CHECK: 1.0 _f +id(0xface+)b_count // CHECK: 0xface+ b_count +id("s")1 // CHECK: "s"1 +id("s"_x)1 // CHECK: "s"_x 1 +id(1)_2_x // CHECK: 1 _2_x |