Skip to content

Commit 19aa4c8

Browse files
authored
[NFC] Fix implicit-fallthrough warnings (#112825)
This is one of the many PRs to fix errors with LLVM_ENABLE_WERROR=on. Built by GCC 11. Fix warnings: clang/lib/Sema/SemaFunctionEffects.cpp:1531:5: error: this statement may fall through [-Werror=implicit-fallthrough=] 1531 | switch (DiffKind) { | ^~~~~~
1 parent 228f88f commit 19aa4c8

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

clang/lib/Sema/SemaFunctionEffects.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1540,6 +1540,7 @@ bool Sema::FunctionEffectDiff::shouldDiagnoseConversion(
15401540
// matching is better.
15411541
return true;
15421542
}
1543+
break;
15431544
case FunctionEffect::Kind::Blocking:
15441545
case FunctionEffect::Kind::Allocating:
15451546
return false;
@@ -1563,6 +1564,7 @@ bool Sema::FunctionEffectDiff::shouldDiagnoseRedeclaration(
15631564
// All these forms of mismatches are diagnosed.
15641565
return true;
15651566
}
1567+
break;
15661568
case FunctionEffect::Kind::Blocking:
15671569
case FunctionEffect::Kind::Allocating:
15681570
return false;
@@ -1592,7 +1594,7 @@ Sema::FunctionEffectDiff::shouldDiagnoseMethodOverride(
15921594
case Kind::ConditionMismatch:
15931595
return OverrideResult::Warn;
15941596
}
1595-
1597+
break;
15961598
case FunctionEffect::Kind::Blocking:
15971599
case FunctionEffect::Kind::Allocating:
15981600
return OverrideResult::NoAction;

llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,7 @@ static unsigned int getFenceOp(NVPTX::Ordering O, NVPTX::Scope S,
10281028
formatv("Unsupported scope \"{}\" for acquire/release/acq_rel fence.",
10291029
ScopeToString(S)));
10301030
}
1031+
break;
10311032
}
10321033
case NVPTX::Ordering::SequentiallyConsistent: {
10331034
switch (S) {
@@ -1046,6 +1047,7 @@ static unsigned int getFenceOp(NVPTX::Ordering O, NVPTX::Scope S,
10461047
report_fatal_error(formatv("Unsupported scope \"{}\" for seq_cst fence.",
10471048
ScopeToString(S)));
10481049
}
1050+
break;
10491051
}
10501052
case NVPTX::Ordering::NotAtomic:
10511053
case NVPTX::Ordering::Relaxed:

0 commit comments

Comments
 (0)