diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-05-09 20:45:16 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-05-09 20:45:16 +0000 |
commit | c056c1792eac0717640f1f48b3739cc9a98ee413 (patch) | |
tree | c93eaa3e95c9c5ff2ea1e336e078a908200e45b1 /lib/Sema/SemaTemplateInstantiate.cpp | |
parent | 023df37c27ee8035664fb62f206ca58f4e2a169d (diff) |
When determining whether we need to instantiate a function type,
also consider whether any of the parameter types (as written, prior to
decay) are dependent. Fixes PR9880 and <rdar://problem/9408413>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131099 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiate.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp index 03c2befbc5..564f099ad9 100644 --- a/lib/Sema/SemaTemplateInstantiate.cpp +++ b/lib/Sema/SemaTemplateInstantiate.cpp @@ -1388,6 +1388,12 @@ static bool NeedsInstantiationAsFunctionType(TypeSourceInfo *T) { for (unsigned I = 0, E = FP.getNumArgs(); I != E; ++I) { ParmVarDecl *P = FP.getArg(I); + // The parameter's type as written might be dependent even if the + // decayed type was not dependent. + if (TypeSourceInfo *TSInfo = P->getTypeSourceInfo()) + if (TSInfo->getType()->isDependentType()) + return true; + // TODO: currently we always rebuild expressions. When we // properly get lazier about this, we should use the same // logic to avoid rebuilding prototypes here. |