Index: lib/Sema/SemaExpr.cpp =================================================================== --- lib/Sema/SemaExpr.cpp +++ lib/Sema/SemaExpr.cpp @@ -12310,7 +12310,14 @@ // Warn about arg1 || arg2 && arg3, as GCC 4.3+ does. // We don't warn for 'assert(a || b && "bad")' since this is safe. - if (Opc == BO_LOr && !OpLoc.isMacroID()/* Don't warn in macros. */) { + StringLiteral* diagnoseRHSToBeString + = dyn_cast(RHSExpr->IgnoreImpCasts()); + if (Opc == BO_LOr && + !(OpLoc.isMacroID() && + diagnoseRHSToBeString) + /* Don't warn in macros, + if and only if RHS could be + evaluated as string */) { DiagnoseLogicalAndInLogicalOrLHS(Self, OpLoc, LHSExpr, RHSExpr); DiagnoseLogicalAndInLogicalOrRHS(Self, OpLoc, LHSExpr, RHSExpr); }