]> granicus.if.org Git - clang/commitdiff
Deallocate 'DeclRefExpr's in correctly formed '#pragma unused'
authorTed Kremenek <kremenek@apple.com>
Mon, 23 Mar 2009 22:50:47 +0000 (22:50 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 23 Mar 2009 22:50:47 +0000 (22:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67573 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaAttr.cpp

index a799169f23611074bfe06c4865afd1daf3dce341..1bf8444c42b74d2da36fed67d8ebf266413ead9b 100644 (file)
@@ -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);
   }
 }