Skip to content

Commit 8f099d1

Browse files
committed
[Preprocessor] Fix warning: left and right subexpressions are identical. NFCI.
This is reported by msvc as warning C6287: redundant code: the left and right subexpressions are identical EmittedDirectiveOnThisLine implies EmittedTokensOnThisLine making this an NFC change. To be on the safe side and because both of them are checked at other places as well, we continue to check both. Compiler warning reported here: https://reviews.llvm.org/D104601#2957333
1 parent 9695027 commit 8f099d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/Frontend/PrintPreprocessedOutput.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ void PrintPPOutputPPCallbacks::HandleWhitespaceBeforeTok(const Token &Tok,
700700
// - The whitespace is necessary to keep the tokens apart and there is not
701701
// already a newline between them
702702
if (RequireSpace || (!MinimizeWhitespace && Tok.hasLeadingSpace()) ||
703-
((EmittedTokensOnThisLine || EmittedTokensOnThisLine) &&
703+
((EmittedTokensOnThisLine || EmittedDirectiveOnThisLine) &&
704704
AvoidConcat(PrevPrevTok, PrevTok, Tok)))
705705
OS << ' ';
706706
}

0 commit comments

Comments
 (0)