[clang] Diagnose misuse of the cleanup attribute (PR #80040)
Bhuminjay Soni via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 9 01:44:59 PST 2024
================
@@ -3780,6 +3780,30 @@ static void handleCleanupAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
<< NI.getName() << ParamTy << Ty;
return;
}
+ VarDecl *VD = cast<VarDecl>(D);
+ // Create a reference to the variable declaration. This is a fake/dummy
+ // reference.
+ DeclRefExpr *VariableReference = DeclRefExpr::Create(
+ S.Context, NestedNameSpecifierLoc{}, SourceLocation{Loc}, VD, false,
----------------
11happy wrote:
Yes I agree with you , should we use `FD->getlocation()` instead?
https://github.com/llvm/llvm-project/pull/80040
More information about the cfe-commits
mailing list