Skip to content

Commit 7e84aa1

Browse files
committed
Fix MSVC "not all control paths return a value" warnings. NFCI.
Add missing llvm_unreachable()'s after each all-enums switch statement.
1 parent 35f2c3a commit 7e84aa1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

clang/lib/Sema/SemaTemplate.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7637,6 +7637,7 @@ static Expr *BuildExpressionFromNonTypeTemplateArgumentValue(
76377637
auto *OVE = new (S.Context) OpaqueValueExpr(Loc, T, VK);
76387638
return ConstantExpr::Create(S.Context, OVE, Val);
76397639
}
7640+
llvm_unreachable("Unhandled APValue::ValueKind enum");
76407641
}
76417642

76427643
ExprResult
@@ -7666,6 +7667,7 @@ Sema::BuildExpressionFromNonTypeTemplateArgument(const TemplateArgument &Arg,
76667667
return BuildExpressionFromNonTypeTemplateArgumentValue(
76677668
*this, Arg.getUncommonValueType(), Arg.getAsUncommonValue(), Loc);
76687669
}
7670+
llvm_unreachable("Unhandled TemplateArgument::ArgKind enum");
76697671
}
76707672

76717673
/// Match two template parameters within template parameter lists.

0 commit comments

Comments
 (0)