[clang] 1d097ad - [clang] Fix -Wimplicit-fallthrough in UnsafeBufferUsage.cpp [NFC]
Jie Fu via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 24 16:35:20 PDT 2023
Author: Jie Fu
Date: 2023-04-25T07:34:39+08:00
New Revision: 1d097ad73b3fe38ff301f471356d15f093a2dbef
URL: https://github.com/llvm/llvm-project/commit/1d097ad73b3fe38ff301f471356d15f093a2dbef
DIFF: https://github.com/llvm/llvm-project/commit/1d097ad73b3fe38ff301f471356d15f093a2dbef.diff
LOG: [clang] Fix -Wimplicit-fallthrough in UnsafeBufferUsage.cpp [NFC]
/Users/jiefu/llvm-project/clang/lib/Analysis/UnsafeBufferUsage.cpp:1272:5: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
case Strategy::Kind::Wontfix:
^
/Users/jiefu/llvm-project/clang/lib/Analysis/UnsafeBufferUsage.cpp:1272:5: note: insert 'LLVM_FALLTHROUGH;' to silence this warning
case Strategy::Kind::Wontfix:
^
LLVM_FALLTHROUGH;
/Users/jiefu/llvm-project/clang/lib/Analysis/UnsafeBufferUsage.cpp:1272:5: note: insert 'break;' to avoid fall-through
case Strategy::Kind::Wontfix:
^
break;
1 error generated.
Added:
Modified:
clang/lib/Analysis/UnsafeBufferUsage.cpp
Removed:
################################################################################
diff --git a/clang/lib/Analysis/UnsafeBufferUsage.cpp b/clang/lib/Analysis/UnsafeBufferUsage.cpp
index 037efc9c5d00..3b58a51195f8 100644
--- a/clang/lib/Analysis/UnsafeBufferUsage.cpp
+++ b/clang/lib/Analysis/UnsafeBufferUsage.cpp
@@ -1269,6 +1269,7 @@ std::optional<FixItList> UPCStandalonePointerGadget::getFixits(const Strategy &S
return FixItList{{FixItHint::CreateInsertion(
*EndOfOperand, ".data()")}};
}
+ [[fallthrough]];
case Strategy::Kind::Wontfix:
case Strategy::Kind::Iterator:
case Strategy::Kind::Array:
More information about the cfe-commits
mailing list