From: Eli Friedman Date: Tue, 16 Dec 2008 20:06:41 +0000 (+0000) Subject: Warning fixes to operator precedence warnings. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e8e3205b22e388588396ef41fd4bbe437d325a57;p=clang Warning fixes to operator precedence warnings. Someone should double-check that I didn't somehow break ObjC serialization; I think the change there actually changes the semantics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61098 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp index 3d9970d2a5..cce824609d 100644 --- a/lib/AST/DeclCXX.cpp +++ b/lib/AST/DeclCXX.cpp @@ -90,13 +90,13 @@ bool CXXRecordDecl::hasConstCopyConstructor(ASTContext &Context) const { = Constructors->function_begin(); Con != Constructors->function_end(); ++Con) { if (cast(*Con)->isCopyConstructor(Context, TypeQuals) && - (TypeQuals & QualType::Const != 0)) + (TypeQuals & QualType::Const) != 0) return true; } } else if (CXXConstructorDecl *Constructor = dyn_cast(*Lookup.first)) { return Constructor->isCopyConstructor(Context, TypeQuals) && - (TypeQuals & QualType::Const != 0); + (TypeQuals & QualType::Const) != 0; } return false; } diff --git a/lib/AST/StmtSerialization.cpp b/lib/AST/StmtSerialization.cpp index aea3d99f19..e25c5cd861 100644 --- a/lib/AST/StmtSerialization.cpp +++ b/lib/AST/StmtSerialization.cpp @@ -1240,7 +1240,7 @@ ObjCMessageExpr* ObjCMessageExpr::CreateImpl(Deserializer& D, ASTContext& C) { // Now read in the arguments. - if (flags & Flags == IsInstMeth) + if ((flags & Flags) == IsInstMeth) D.BatchReadOwnedPtrs(NumArgs+1, SubExprs, C); else { // Read the pointer for Cls/ClassName. The Deserializer will handle the diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp index d55d0f81bc..fe61001709 100644 --- a/lib/CodeGen/CGCXX.cpp +++ b/lib/CodeGen/CGCXX.cpp @@ -28,7 +28,7 @@ using namespace CodeGen; static void mangleDeclContextInternal(const DeclContext *D, std::string &S) { // FIXME: Should ObjcMethodDecl have the TranslationUnitDecl as its parent? - assert(!D->getParent() || isa(D->getParent()) && + assert((!D->getParent() || isa(D->getParent())) && "Only one level of decl context mangling is currently supported!"); if (const FunctionDecl* FD = dyn_cast(D)) {