/// WARNING: Indexes apply to particular diagnostics only!
///
/// \returns diagnostic %select index.
-static unsigned getRedeclDiagFromTagKind(TagTypeKind Tag)
-{
+static unsigned getRedeclDiagFromTagKind(TagTypeKind Tag) {
switch (Tag) {
- case TTK_Struct: return 0;
- case TTK_Interface: return 1;
- case TTK_Class: return 2;
- default: assert("Invalid tag kind for redecl diagnostic!");
+ case TTK_Struct: return 0;
+ case TTK_Interface: return 1;
+ case TTK_Class: return 2;
+ default: llvm_unreachable("Invalid tag kind for redecl diagnostic!");
}
- return -1;
}
/// \brief Determine if tag kind is a class-key compatible with
/// WARNING: Indexes apply to particular diagnostics only!
///
/// \returns diagnostic %select index.
-static unsigned getRecordDiagFromTagKind(TagTypeKind Tag)
-{
+static unsigned getRecordDiagFromTagKind(TagTypeKind Tag) {
switch (Tag) {
- case TTK_Struct: return 0;
- case TTK_Interface: return 1;
- case TTK_Class: return 2;
- default: assert("Invalid tag kind for record diagnostic!");
+ case TTK_Struct: return 0;
+ case TTK_Interface: return 1;
+ case TTK_Class: return 2;
+ default: llvm_unreachable("Invalid tag kind for record diagnostic!");
}
- return -1;
}
// CheckConstexprFunctionDecl - Check whether a function declaration satisfies
/// WARNING: Indexes apply to particular diagnostics only!
///
/// \returns diagnostic %select index.
-static unsigned getLiteralDiagFromTagKind(TagTypeKind Tag)
-{
+static unsigned getLiteralDiagFromTagKind(TagTypeKind Tag) {
switch (Tag) {
- case TTK_Struct: return 0;
- case TTK_Interface: return 1;
- case TTK_Class: return 2;
- default: assert("Invalid tag kind for literal type diagnostic!");
+ case TTK_Struct: return 0;
+ case TTK_Interface: return 1;
+ case TTK_Class: return 2;
+ default: llvm_unreachable("Invalid tag kind for literal type diagnostic!");
}
- return -1;
}
/// @brief Ensure that the type T is a literal type.