Skip to content

Commit 7706224

Browse files
committed
Fix two instances of -Wparentheses warnings [NFC]
Add parentheses around the assert conditions. Without this gcc warned like ../lib/Target/AMDGPU/GCNSchedStrategy.cpp:2250: warning: suggest parentheses around '&&' within '||' [-Wparentheses] 2250 | NewMI != RegionBounds.second && "cannot remove at region end"); and ../../clang/lib/Sema/SemaOverload.cpp:11326:39: warning: suggest parentheses around '&&' within '||' [-Wparentheses] 11326 | DeferredCandidatesCount == 0 && | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ 11327 | "Unexpected deferred template candidates"); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 parent 6157028 commit 7706224

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

clang/lib/Sema/SemaOverload.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11322,9 +11322,9 @@ OverloadingResult OverloadCandidateSet::BestViableFunction(Sema &S,
1132211322
SourceLocation Loc,
1132311323
iterator &Best) {
1132411324

11325-
assert(shouldDeferTemplateArgumentDeduction(S.getLangOpts()) ||
11326-
DeferredCandidatesCount == 0 &&
11327-
"Unexpected deferred template candidates");
11325+
assert((shouldDeferTemplateArgumentDeduction(S.getLangOpts()) ||
11326+
DeferredCandidatesCount == 0) &&
11327+
"Unexpected deferred template candidates");
1132811328

1132911329
bool TwoPhaseResolution =
1133011330
DeferredCandidatesCount != 0 && !ResolutionByPerfectCandidateIsDisabled;

llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2246,8 +2246,8 @@ void PreRARematStage::finalizeGCNSchedStage() {
22462246
void GCNScheduleDAGMILive::updateRegionBoundaries(
22472247
RegionBoundaries &RegionBounds, MachineBasicBlock::iterator MI,
22482248
MachineInstr *NewMI) {
2249-
assert(!NewMI ||
2250-
NewMI != RegionBounds.second && "cannot remove at region end");
2249+
assert((!NewMI || NewMI != RegionBounds.second) &&
2250+
"cannot remove at region end");
22512251

22522252
if (RegionBounds.first == RegionBounds.second) {
22532253
assert(NewMI && "cannot remove from an empty region");

0 commit comments

Comments
 (0)