if (PrevColNum != 0 && CurColNum != 0 && StmtColNum != 0 &&
((PrevColNum > StmtColNum && PrevColNum == CurColNum) ||
- !Tok.isAtStartOfLine()) && SM.getPresumedLineNumber(StmtLoc) !=
- SM.getPresumedLineNumber(Tok.getLocation())) {
- P.Diag(Tok.getLocation(), diag::warn_misleading_indentation)
- << Kind;
+ !Tok.isAtStartOfLine()) &&
+ SM.getPresumedLineNumber(StmtLoc) !=
+ SM.getPresumedLineNumber(Tok.getLocation()) &&
+ (Tok.isNot(tok::identifier) ||
+ P.getPreprocessor().LookAhead(0).isNot(tok::colon))) {
+ P.Diag(Tok.getLocation(), diag::warn_misleading_indentation) << Kind;
P.Diag(StmtLoc, diag::note_previous_statement);
}
}