diff options
author | Reid Kleckner <reid@kleckner.net> | 2013-07-31 21:00:18 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2013-07-31 21:00:18 +0000 |
commit | a09e44c75d13edfbdc0a70bf517e625886e092db (patch) | |
tree | 8f2c96ad2f1615c0f76d34ecdab2df42e6553b1d /clang/lib/Sema/SemaTemplateInstantiate.cpp | |
parent | 1907610d4e1cd85634d8e7e31001fdf899cc3ad5 (diff) | |
download | bcm5719-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.cpp | 3 |
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()) |