]> granicus.if.org Git - clang/commitdiff
Don't emit warn_logical_and_in_logical_or for macros. Fixes rdar://8678458
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 17 Nov 2010 18:54:22 +0000 (18:54 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 17 Nov 2010 18:54:22 +0000 (18:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119537 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExpr.cpp

index 17563fe3e4f4d4bf4fefe97304882c2c9634dd3e..7a73ad633f4ab5bd538778291fd4f49831142473 100644 (file)
@@ -7393,7 +7393,7 @@ static void DiagnoseBinOpPrecedence(Sema &Self, BinaryOperatorKind Opc,
 
   // 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) {
+  if (Opc == BO_LOr && !OpLoc.isMacroID()/* Don't warn in macros. */) {
     DiagnoseLogicalAndInLogicalOrLHS(Self, OpLoc, lhs);
     DiagnoseLogicalAndInLogicalOrRHS(Self, OpLoc, rhs);
   }