================
@@ -2772,7 +2772,7 @@ fixVariable(const VarDecl *VD, FixitStrategy::Kind K,
// also covers call-operator of lamdas
isa<CXXMethodDecl>(FD) ||
// skip when the function body is a try-block
- (FD->hasBody() && isa<CXXTryStmt>(FD->getBody())) ||
+ isa_and_nonnull<CXXTryStmt>(FD->getBody()) ||
----------------
NagyDonat wrote:
The comment before the definition of `getBody()` says that
```
/// NOTE: For checking if there is a body, use hasBody() instead, to avoid
/// unnecessary AST de-serialization of the body.
```
so perhaps it would be better to keep `hasBody()`. (Although I don't know
whether performance is relevant at this point -- if we're handling an unusual
case, then the runtime doesn't matter.)
https://github.com/llvm/llvm-project/pull/94987
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits