summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/TokenConcatenation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Lex/TokenConcatenation.cpp')
-rw-r--r--clang/lib/Lex/TokenConcatenation.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/clang/lib/Lex/TokenConcatenation.cpp b/clang/lib/Lex/TokenConcatenation.cpp
index 0a66bba91fc..866cbb142c8 100644
--- a/clang/lib/Lex/TokenConcatenation.cpp
+++ b/clang/lib/Lex/TokenConcatenation.cpp
@@ -163,8 +163,8 @@ bool TokenConcatenation::AvoidConcat(const Token &PrevPrevTok,
return false;
tok::TokenKind PrevKind = PrevTok.getKind();
- if (PrevTok.getIdentifierInfo()) // Language keyword or named operator.
- PrevKind = tok::identifier;
+ if (!PrevTok.isAnnotation() && PrevTok.getIdentifierInfo())
+ PrevKind = tok::identifier; // Language keyword or named operator.
// Look up information on when we should avoid concatenation with prevtok.
unsigned ConcatInfo = TokenInfo[PrevKind];
@@ -178,6 +178,14 @@ bool TokenConcatenation::AvoidConcat(const Token &PrevPrevTok,
return true;
ConcatInfo &= ~aci_avoid_equal;
}
+ if (Tok.isAnnotation()) {
+ // Modules annotation can show up when generated automatically for includes.
+ assert((Tok.is(tok::annot_module_include) ||
+ Tok.is(tok::annot_module_begin) ||
+ Tok.is(tok::annot_module_end)) &&
+ "unexpected annotation in AvoidConcat");
+ ConcatInfo = 0;
+ }
if (ConcatInfo == 0) return false;
OpenPOWER on IntegriCloud