summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateInstantiate.cpp
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2013-07-31 21:00:18 +0000
committerReid Kleckner <reid@kleckner.net>2013-07-31 21:00:18 +0000
commita09e44c75d13edfbdc0a70bf517e625886e092db (patch)
tree8f2c96ad2f1615c0f76d34ecdab2df42e6553b1d /clang/lib/Sema/SemaTemplateInstantiate.cpp
parent1907610d4e1cd85634d8e7e31001fdf899cc3ad5 (diff)
downloadbcm5719-llvm-a09e44c75d13edfbdc0a70bf517e625886e092db.tar.gz
bcm5719-llvm-a09e44c75d13edfbdc0a70bf517e625886e092db.zip
Fix declaring class template methods with an attributed typedef
This change unifies the logic for template instantiation of methods and functions declared with typedefs. It ensures that SubstFunctionType() always fills the Params out param with non-null ParmVarDecls or returns null. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D1135 llvm-svn: 187528
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiate.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp
index 67b53b4c0a7..57eb64d127a 100644
--- a/clang/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp
@@ -1577,6 +1577,9 @@ static bool NeedsInstantiationAsFunctionType(TypeSourceInfo *T) {
for (unsigned I = 0, E = FP.getNumArgs(); I != E; ++I) {
ParmVarDecl *P = FP.getArg(I);
+ // This must be synthesized from a typedef.
+ if (!P) continue;
+
// The parameter's type as written might be dependent even if the
// decayed type was not dependent.
if (TypeSourceInfo *TSInfo = P->getTypeSourceInfo())
OpenPOWER on IntegriCloud