From: Argyrios Kyrtzidis Date: Mon, 6 Dec 2010 17:51:53 +0000 (+0000) Subject: Use Sema's MarkDeclarationReferenced, which takes care of templates, instead of calli... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=223ae5c26654e5fd7dacdafe43aff28a096ba63b;p=clang Use Sema's MarkDeclarationReferenced, which takes care of templates, instead of calling Decl's setUsed directly. Thanks to John for the hint! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121014 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index d53fd6822d..05b141b245 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -1452,7 +1452,7 @@ static void HandleCleanupAttr(Decl *d, const AttributeList &Attr, Sema &S) { } d->addAttr(::new (S.Context) CleanupAttr(Attr.getLoc(), S.Context, FD)); - FD->setUsed(); + S.MarkDeclarationReferenced(Attr.getParameterLoc(), FD); } /// Handle __attribute__((format_arg((idx)))) attribute based on