[PATCH] D39127: Fix template parameter default args missed if redecled

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 23 18:42:07 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL316405: Fix template parameter default args missed if redecled (authored by erichkeane).

Changed prior to commit:
  https://reviews.llvm.org/D39127?vs=119665&id=119991#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D39127

Files:
  cfe/trunk/lib/Sema/SemaTemplate.cpp


Index: cfe/trunk/lib/Sema/SemaTemplate.cpp
===================================================================
--- cfe/trunk/lib/Sema/SemaTemplate.cpp
+++ cfe/trunk/lib/Sema/SemaTemplate.cpp
@@ -4805,7 +4805,12 @@
   // template.
   TemplateArgumentListInfo NewArgs = TemplateArgs;
 
-  TemplateParameterList *Params = Template->getTemplateParameters();
+  // Make sure we get the template parameter list from the most
+  // recentdeclaration, since that is the only one that has is guaranteed to
+  // have all the default template argument information.
+  TemplateParameterList *Params =
+      cast<TemplateDecl>(Template->getMostRecentDecl())
+          ->getTemplateParameters();
 
   SourceLocation RAngleLoc = NewArgs.getRAngleLoc();
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39127.119991.patch
Type: text/x-patch
Size: 743 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171024/e637757e/attachment.bin>


More information about the cfe-commits mailing list