]> granicus.if.org Git - clang/commitdiff
PR21305: Typedefs in non-type template parameters in member data pointers.
authorDavid Blaikie <dblaikie@gmail.com>
Sat, 18 Oct 2014 02:21:26 +0000 (02:21 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Sat, 18 Oct 2014 02:21:26 +0000 (02:21 +0000)
Patch by Stephen Crane!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220122 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp
test/CodeGenCXX/debug-info-template.cpp

index ac51a55d15f744b2376699b92af494857414fefd..732071f29af7c471447f5c193231608d12874503 100644 (file)
@@ -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
index d1b13d03307d509c9d5e75d1b5b72b694bf8c166..126a09f83a8ae73ab23f660bd8a9ea32058350bd 100644 (file)
@@ -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 {
   };