[clang] 41751b6 - [Clang][ASan] Correct AsanDtorKindToString to return non-void in default case
Kostya Kortchinsky via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 25 15:32:51 PST 2021
Author: Kostya Kortchinsky
Date: 2021-02-25T15:32:18-08:00
New Revision: 41751b637317bd9c97b0506ba77075694cd2d9cf
URL: https://github.com/llvm/llvm-project/commit/41751b637317bd9c97b0506ba77075694cd2d9cf
DIFF: https://github.com/llvm/llvm-project/commit/41751b637317bd9c97b0506ba77075694cd2d9cf.diff
LOG: [Clang][ASan] Correct AsanDtorKindToString to return non-void in default case
Post D96572, a warning started showing up for me:
`clang/lib/Basic/Sanitizers.cpp:73:1: warning: control reaches end of non-void function [-Wreturn-type]`
So this adds a default to the case to return invalid, which seems appropriate,
and appears to correct the issue.
Differential Revision: https://reviews.llvm.org/D97496
Added:
Modified:
clang/lib/Basic/Sanitizers.cpp
Removed:
################################################################################
diff --git a/clang/lib/Basic/Sanitizers.cpp b/clang/lib/Basic/Sanitizers.cpp
index f4cd841b91dce..d8de850485eb4 100644
--- a/clang/lib/Basic/Sanitizers.cpp
+++ b/clang/lib/Basic/Sanitizers.cpp
@@ -70,6 +70,7 @@ StringRef AsanDtorKindToString(llvm::AsanDtorKind kind) {
case llvm::AsanDtorKind::Invalid:
return "invalid";
}
+ return "invalid";
}
llvm::AsanDtorKind AsanDtorKindFromString(StringRef kindStr) {
More information about the cfe-commits
mailing list