From: Ted Kremenek Date: Mon, 23 Mar 2009 22:50:47 +0000 (+0000) Subject: Deallocate 'DeclRefExpr's in correctly formed '#pragma unused' X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=45a3c05640b1b08e7f7f69f633f899fd0e792f3c;p=clang Deallocate 'DeclRefExpr's in correctly formed '#pragma unused' git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67573 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaAttr.cpp b/lib/Sema/SemaAttr.cpp index a799169f23..1bf8444c42 100644 --- a/lib/Sema/SemaAttr.cpp +++ b/lib/Sema/SemaAttr.cpp @@ -206,5 +206,6 @@ void Sema::ActOnPragmaUnused(ExprTy **Exprs, unsigned NumExprs, for (unsigned i = 0; i < NumExprs; ++i) { DeclRefExpr *DR = (DeclRefExpr*) Exprs[i]; DR->getDecl()->addAttr(::new (Context) UnusedAttr()); + DR->Destroy(Context); } }