From: David Blaikie Date: Sat, 18 Oct 2014 02:21:26 +0000 (+0000) Subject: PR21305: Typedefs in non-type template parameters in member data pointers. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=df77101cd0d696626dae2ce17151d456193805ec;p=clang PR21305: Typedefs in non-type template parameters in member data pointers. Patch by Stephen Crane! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220122 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index ac51a55d15..732071f29a 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -1255,7 +1255,7 @@ CollectTemplateParams(const TemplateParameterList *TPList, } break; case TemplateArgument::Declaration: { const ValueDecl *D = TA.getAsDecl(); - QualType T = TA.getParamTypeForDecl(); + QualType T = TA.getParamTypeForDecl().getDesugaredType(CGM.getContext()); llvm::DIType TTy = getOrCreateType(T, Unit); llvm::Value *V = nullptr; // Variable pointer template parameters have a value that is the address diff --git a/test/CodeGenCXX/debug-info-template.cpp b/test/CodeGenCXX/debug-info-template.cpp index d1b13d0330..126a09f83a 100644 --- a/test/CodeGenCXX/debug-info-template.cpp +++ b/test/CodeGenCXX/debug-info-template.cpp @@ -97,7 +97,9 @@ struct foo { void f(); }; -template +typedef int foo::*foo_mem; + +template struct TC { struct nested { };