Author: Bjorn Pettersson Date: 2023-08-23T14:27:08+02:00 New Revision: f6720947101f2866ca4812056842ada06cf59242
URL: https://github.com/llvm/llvm-project/commit/f6720947101f2866ca4812056842ada06cf59242 DIFF: https://github.com/llvm/llvm-project/commit/f6720947101f2866ca4812056842ada06cf59242.diff LOG: [Sema] Fix -Wparentheses warning seen with gcc This patch simply replace assert(X || Y && "...") by assert((X || Y) && "...") to silence -Wparentheses warnings. Added: Modified: clang/lib/Sema/SemaDecl.cpp Removed: ################################################################################ diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 8e5920b8babeb2..3925e2a7f3382c 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -14379,10 +14379,9 @@ void Sema::CheckCompleteVariableDeclaration(VarDecl *var) { if (Stack != &ConstSegStack && MSVCEnv && ConstSegStack.CurrentValue != ConstSegStack.DefaultValue && var->getType().isConstQualified()) { - assert(!Reason || - Reason != QualType::NonConstantStorageReason:: - NonConstNonReferenceType && - "This case should've already been handled elsewhere"); + assert((!Reason || Reason != QualType::NonConstantStorageReason:: + NonConstNonReferenceType) && + "This case should've already been handled elsewhere"); Diag(var->getLocation(), diag::warn_section_msvc_compat) << var << ConstSegStack.CurrentValue << (int)(!HasConstInit ? QualType::NonConstantStorageReason::NonTrivialCtor _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits