Skip to content

Commit

Permalink
[Sema] Fix -Wparentheses warning seen with gcc
Browse files Browse the repository at this point in the history
This patch simply replace
  assert(X || Y && "...")
by
  assert((X || Y) && "...")
to silence -Wparentheses warnings.
  • Loading branch information
bjope committed Aug 23, 2023
1 parent a23e01a commit f672094
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions clang/lib/Sema/SemaDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f672094

Please sign in to comment.