================
@@ -14735,6 +14735,24 @@ StmtResult Sema::ActOnCXXForRangeIdentifier(Scope *S,
SourceLocation IdentLoc,
: IdentLoc);
}
+void Sema::addLifetimeBoundToImplicitThis(const CXXMethodDecl *MD) {
+ CXXMethodDecl *MutableMD = const_cast<CXXMethodDecl *>(MD);
+ if (lifetimes::implicitObjectParamIsLifetimeBound(MutableMD))
+ return;
+ auto *Attr =
+ LifetimeBoundAttr::CreateImplicit(Context, MutableMD->getLocation());
+ QualType MethodType = MutableMD->getType();
+ QualType AttributedType =
+ Context.getAttributedType(attr::LifetimeBound, MethodType, MethodType);
----------------
usx95 wrote:
nit: use `ASTContext::getAttributedType(const Attr *attr, QualType
modifiedType,QualType equivalentType)` and pass `Attr` to it.
https://github.com/llvm/llvm-project/pull/176703
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits