diff options
Diffstat (limited to 'clang/Lex/Lexer.cpp')
| -rw-r--r-- | clang/Lex/Lexer.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/clang/Lex/Lexer.cpp b/clang/Lex/Lexer.cpp index 1344cfe7c8d..69c3a878dd1 100644 --- a/clang/Lex/Lexer.cpp +++ b/clang/Lex/Lexer.cpp @@ -1200,11 +1200,15 @@ LexNextToken: CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); } else if (Features.Digraphs && Char == ':') { CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); - if (getCharAndSize(CurPtr, SizeTmp) == '%' && - getCharAndSize(CurPtr+SizeTmp, SizeTmp2) == ':') { + Char = getCharAndSize(CurPtr, SizeTmp); + if (Char == '%' && getCharAndSize(CurPtr+SizeTmp, SizeTmp2) == ':') { Result.SetKind(tok::hashhash); // '%:%:' -> '##' CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result), SizeTmp2, Result); + } else if (Char == '@' && Features.Microsoft) { // %:@ -> #@ -> Charize + Result.SetKind(tok::hashat); + CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); + Diag(BufferPtr, diag::charize_microsoft_ext); } else { Result.SetKind(tok::hash); // '%:' -> '#' @@ -1351,6 +1355,10 @@ LexNextToken: if (Char == '#') { Result.SetKind(tok::hashhash); CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); + } else if (Char == '@' && Features.Microsoft) { // #@ -> Charize + Result.SetKind(tok::hashat); + Diag(BufferPtr, diag::charize_microsoft_ext); + CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); } else { Result.SetKind(tok::hash); // We parsed a # character. If this occurs at the start of the line, |

