[clang] e55bda0 - [NFC] Fix the warning Wcovered-switch-default
Chuanqi Xu via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 14 19:39:37 PST 2023
Author: Chuanqi Xu
Date: 2023-12-15T11:39:20+08:00
New Revision: e55bda06dc2bb1ef11ff4fcc43f90d8bf843f967
URL: https://github.com/llvm/llvm-project/commit/e55bda06dc2bb1ef11ff4fcc43f90d8bf843f967
DIFF: https://github.com/llvm/llvm-project/commit/e55bda06dc2bb1ef11ff4fcc43f90d8bf843f967.diff
LOG: [NFC] Fix the warning Wcovered-switch-default
There is a warning saying:
ASTWriter.h:766:5: error: default label in switch which covers all
enumeration values [-Werror,-Wcovered-switch-default]
766 | default:
| ^
1 error generated.
And this patch tries to fix this.
Added:
Modified:
clang/include/clang/Serialization/ASTWriter.h
Removed:
################################################################################
diff --git a/clang/include/clang/Serialization/ASTWriter.h b/clang/include/clang/Serialization/ASTWriter.h
index 16ab9583f8ed8e..de69f99003d827 100644
--- a/clang/include/clang/Serialization/ASTWriter.h
+++ b/clang/include/clang/Serialization/ASTWriter.h
@@ -763,9 +763,8 @@ class ASTWriter : public ASTDeserializationListener,
return DeclDependentNonTemplateCXXMethodAbbrev;
case FunctionDecl::TK_DependentFunctionTemplateSpecialization:
return DeclDependentSpecializationCXXMethodAbbrev;
- default:
- llvm_unreachable("Unknwon Template Kind!");
}
+ llvm_unreachable("Unknwon Template Kind!");
}
unsigned getDeclTemplateTypeParmAbbrev() const {
return DeclTemplateTypeParmAbbrev;
More information about the cfe-commits
mailing list