[PATCH] D139737: [-Wunsafe-buffer-usage] Initiate Fix-it generation for local variable declarations

Jan Korous via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 27 11:51:24 PST 2023


jkorous added inline comments.


================
Comment at: clang/lib/Analysis/UnsafeBufferUsage.cpp:127
+static auto isInUnspecifiedLvalueContext(internal::Matcher<Expr> innerMatcher) {
+  auto isLvalueToRvalueCast = [](internal::Matcher<Expr> M) {
+    return implicitCastExpr(hasCastKind(CastKind::CK_LValueToRValue),
----------------
Nit: I think we could simplify this to just

```
static auto isInUnspecifiedLvalueContext(internal::Matcher<Expr> innerMatcher) {
  return implicitCastExpr(hasCastKind(CastKind::CK_LValueToRValue),
                          castSubExpr(innerMatcher));
}
```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139737/new/

https://reviews.llvm.org/D139737



More information about the cfe-commits mailing list