Skip to content

Commit ec71238

Browse files
committed
Fix clang -Wcovered-switch-default after llvmorg-10-init-11484-g6626e5a06a9
We need to place llvm_unreachable after switch to work around the GCC warning.
1 parent 92f94b7 commit ec71238

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/Sema/SemaDeclCXX.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7103,7 +7103,6 @@ class DefaultedComparisonVisitor {
71037103
ResultList Results;
71047104

71057105
switch (DCK) {
7106-
default:
71077106
case DefaultedComparisonKind::None:
71087107
llvm_unreachable("not a defaulted comparison");
71097108

@@ -7118,6 +7117,7 @@ class DefaultedComparisonVisitor {
71187117
ParamLvalType, getDerived().getCompleteObject()));
71197118
return Results;
71207119
}
7120+
llvm_unreachable("");
71217121
}
71227122

71237123
protected:
@@ -7593,7 +7593,6 @@ class DefaultedComparisonSynthesizer
75937593
return StmtError();
75947594

75957595
switch (DCK) {
7596-
default:
75977596
case DefaultedComparisonKind::None:
75987597
llvm_unreachable("not a defaulted comparison");
75997598

@@ -7660,6 +7659,7 @@ class DefaultedComparisonSynthesizer
76607659
// Otherwise, the operator function yields x @ y.
76617660
return Op.get();
76627661
}
7662+
llvm_unreachable("");
76637663
}
76647664

76657665
/// Build "static_cast<R>(E)".

0 commit comments

Comments
 (0)