diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-12-23 23:03:06 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-12-23 23:03:06 +0000 |
commit | 036aed18662e0193aafe0e8ae13d2e57efe6df25 (patch) | |
tree | 40e67da6505f06471a854249e0a3ac17fd1c6045 /lib/Sema/SemaTemplateInstantiate.cpp | |
parent | 8d9fb9b21364892b5e41ebfacdad8f41414d2b89 (diff) |
When we see a CXXDefaultArgExpr during template instantiation, rebuild
the default argument so that we're sure to mark any referenced
declarations. This gets us another little step closer to fixing
PR5810.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92078 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiate.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp index dddb93c87e..d65b246567 100644 --- a/lib/Sema/SemaTemplateInstantiate.cpp +++ b/lib/Sema/SemaTemplateInstantiate.cpp @@ -785,7 +785,9 @@ Sema::OwningExprResult TemplateInstantiator::TransformCXXDefaultArgExpr( assert(!cast<FunctionDecl>(E->getParam()->getDeclContext())-> getDescribedFunctionTemplate() && "Default arg expressions are never formed in dependent cases."); - return SemaRef.Owned(E->Retain()); + return SemaRef.BuildCXXDefaultArgExpr(E->getUsedLocation(), + cast<FunctionDecl>(E->getParam()->getDeclContext()), + E->getParam()); } |