From d67aea28f6cb180291f95690ece485740f3fe859 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 6 Mar 2012 03:21:47 +0000 Subject: 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. llvm-svn: 152098 --- clang/lib/Lex/Lexer.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'clang/lib/Lex/Lexer.cpp') diff --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp index 2b24d1cc75e..a7fba8019d3 100644 --- a/clang/lib/Lex/Lexer.cpp +++ b/clang/lib/Lex/Lexer.cpp @@ -1582,6 +1582,7 @@ const char *Lexer::LexUDSuffix(Token &Result, const char *CurPtr) { unsigned Size; char C = getCharAndSize(CurPtr, Size); if (isIdentifierHead(C)) { + Result.setFlag(Token::HasUDSuffix); do { CurPtr = ConsumeChar(CurPtr, Size, Result); C = getCharAndSize(CurPtr, Size); -- cgit v1.2.3