diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-05-04 16:12:48 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-05-04 16:12:48 +0000 |
commit | 8aaf5818a64e9f7687798852af5945b053c68a54 (patch) | |
tree | d6a70c3518b8dea8be7062438d7e8676820ed17f /lib/Lex/TokenConcatenation.cpp | |
parent | 71438373cd57f0d5d8c93bb5cf690844a0fbc9d0 (diff) | |
download | FreeBSD-src-8aaf5818a64e9f7687798852af5945b053c68a54.zip FreeBSD-src-8aaf5818a64e9f7687798852af5945b053c68a54.tar.gz |
Update clang to r103004.
Diffstat (limited to 'lib/Lex/TokenConcatenation.cpp')
-rw-r--r-- | lib/Lex/TokenConcatenation.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Lex/TokenConcatenation.cpp b/lib/Lex/TokenConcatenation.cpp index 51d2e23..fc6db21 100644 --- a/lib/Lex/TokenConcatenation.cpp +++ b/lib/Lex/TokenConcatenation.cpp @@ -124,7 +124,8 @@ static char GetFirstChar(Preprocessor &PP, const Token &Tok) { /// but the resulting output won't have incorrect concatenations going on. /// Examples include "..", which we print with a space between, because we /// don't want to track enough to tell "x.." from "...". -bool TokenConcatenation::AvoidConcat(const Token &PrevTok, +bool TokenConcatenation::AvoidConcat(const Token &PrevPrevTok, + const Token &PrevTok, const Token &Tok) const { // First, check to see if the tokens were directly adjacent in the original // source. If they were, it must be okay to stick them together: if there @@ -192,7 +193,8 @@ bool TokenConcatenation::AvoidConcat(const Token &PrevTok, return isalnum(FirstChar) || Tok.is(tok::numeric_constant) || FirstChar == '+' || FirstChar == '-' || FirstChar == '.'; case tok::period: // ..., .*, .1234 - return FirstChar == '.' || isdigit(FirstChar) || + return (FirstChar == '.' && PrevPrevTok.is(tok::period)) || + isdigit(FirstChar) || (PP.getLangOptions().CPlusPlus && FirstChar == '*'); case tok::amp: // && return FirstChar == '&'; |