From 8f099d17a1bee857ada3c5af032cfcb559252024 Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Fri, 5 Nov 2021 00:13:49 -0500 Subject: [PATCH] [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 --- clang/lib/Frontend/PrintPreprocessedOutput.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/Frontend/PrintPreprocessedOutput.cpp b/clang/lib/Frontend/PrintPreprocessedOutput.cpp index 360fa14..fadf0c0 100644 --- a/clang/lib/Frontend/PrintPreprocessedOutput.cpp +++ b/clang/lib/Frontend/PrintPreprocessedOutput.cpp @@ -700,7 +700,7 @@ void PrintPPOutputPPCallbacks::HandleWhitespaceBeforeTok(const Token &Tok, // - The whitespace is necessary to keep the tokens apart and there is not // already a newline between them if (RequireSpace || (!MinimizeWhitespace && Tok.hasLeadingSpace()) || - ((EmittedTokensOnThisLine || EmittedTokensOnThisLine) && + ((EmittedTokensOnThisLine || EmittedDirectiveOnThisLine) && AvoidConcat(PrevPrevTok, PrevTok, Tok))) OS << ' '; } -- 2.7.4