r220122 - PR21305: Typedefs in non-type template parameters in member data pointers.

David Blaikie dblaikie at gmail.com
Fri Oct 17 19:21:26 PDT 2014


Author: dblaikie
Date: Fri Oct 17 21:21:26 2014
New Revision: 220122

URL: http://llvm.org/viewvc/llvm-project?rev=220122&view=rev
Log:
PR21305: Typedefs in non-type template parameters in member data pointers.

Patch by Stephen Crane!

Modified:
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
    cfe/trunk/test/CodeGenCXX/debug-info-template.cpp

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=220122&r1=220121&r2=220122&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Fri Oct 17 21:21:26 2014
@@ -1255,7 +1255,7 @@ CollectTemplateParams(const TemplatePara
     } 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

Modified: cfe/trunk/test/CodeGenCXX/debug-info-template.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-template.cpp?rev=220122&r1=220121&r2=220122&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-template.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info-template.cpp Fri Oct 17 21:21:26 2014
@@ -97,7 +97,9 @@ struct foo {
   void f();
 };
 
-template<typename T, T, const int *x, int foo::*a, void (foo::*b)(), void (*f)(), int ...Is>
+typedef int foo::*foo_mem;
+
+template<typename T, T, const int *x, foo_mem a, void (foo::*b)(), void (*f)(), int ...Is>
 struct TC {
   struct nested {
   };





More information about the cfe-commits mailing list