diff options
author | Adrian Prantl <aprantl@apple.com> | 2014-04-17 00:30:48 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2014-04-17 00:30:48 +0000 |
commit | 2c92e9cb53b8a0da29fe0392d6a1f324aae36116 (patch) | |
tree | 5c8630cc6a5d67387868adaffdcc455b35d5ec43 /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | 5f6268a40ee3e17bbec910329f5b4e8eb940069f (diff) | |
download | bcm5719-llvm-2c92e9cb53b8a0da29fe0392d6a1f324aae36116.tar.gz bcm5719-llvm-2c92e9cb53b8a0da29fe0392d6a1f324aae36116.zip |
Debug info: When collecting the parameters of C++ partial template
specializations collect all arguments and not just the ones from the
class template partial specialization from which this class template
specialization was instantiated. The debug info does not represent the
partial specialization otherwise and so specialized parameters would
go missing.
rdar://problem/16636569.
llvm-svn: 206430
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 8e06bbd34b6..dc49e1865ed 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1360,10 +1360,16 @@ CollectCXXTemplateParams(const ClassTemplateSpecializationDecl *TSpecial, ClassTemplatePartialSpecializationDecl *> PU = TSpecial->getSpecializedTemplateOrPartial(); - TemplateParameterList *TPList = PU.is<ClassTemplateDecl *>() ? - PU.get<ClassTemplateDecl *>()->getTemplateParameters() : - PU.get<ClassTemplatePartialSpecializationDecl *>()->getTemplateParameters(); - const TemplateArgumentList &TAList = TSpecial->getTemplateInstantiationArgs(); + TemplateParameterList *TPList; + if (auto *CTD = PU.dyn_cast<ClassTemplateDecl *>()) + TPList = CTD->getTemplateParameters(); + else { + // Always get the full list of parameters, not just the ones from + // the specialization. + auto *CTPSD = PU.get<ClassTemplatePartialSpecializationDecl *>(); + TPList = CTPSD->getSpecializedTemplate()->getTemplateParameters(); + } + const TemplateArgumentList &TAList = TSpecial->getTemplateArgs(); return CollectTemplateParams(TPList, TAList.asArray(), Unit); } |