diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-08-08 01:41:12 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-08-08 01:41:12 +0000 |
commit | 43d9d9243329b1b75d1a6efdad9f16d6fb386b8e (patch) | |
tree | d788e8c42f7e7838e8a707e93e0bbb307197f9a7 /lib/Sema/SemaTemplateInstantiateDecl.cpp | |
parent | 80e4b9e0e87064a824d72b6ff89074206ecced58 (diff) |
Introduce reference counting for statements and expressions, using it
to allow sharing of nodes. Simplifies some aspects of template
instantiation, and fixes both PR3444 and <rdar://problem/6757457>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78450 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiateDecl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index 021a6ad2ab..1c98fca6af 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -222,7 +222,8 @@ Decl *TemplateDeclInstantiator::VisitStaticAssertDecl(StaticAssertDecl *D) { if (InstantiatedAssertExpr.isInvalid()) return 0; - OwningExprResult Message = SemaRef.Clone(D->getMessage()); + OwningExprResult Message(SemaRef, D->getMessage()); + D->getMessage()->Retain(); Decl *StaticAssert = SemaRef.ActOnStaticAssertDeclaration(D->getLocation(), move(InstantiatedAssertExpr), |