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

Martin Storsjö via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 21 06:21:53 PDT 2017


mstorsjo added inline comments.


================
Comment at: lib/Sema/SemaTemplate.cpp:4808
+  // 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.
----------------
Typo in "recentdeclaration"


================
Comment at: lib/Sema/SemaTemplate.cpp:4811
+  TemplateParameterList *Params =
+      cast<TemplateDecl>(Template->getMostRecentDecl())
+          ->getTemplateParameters();
----------------
How does this work if there's another forward declaration missing the parameter later? Is the logic with "most recent" ok, or should it be "most qualified/complete" instead?


https://reviews.llvm.org/D39127





More information about the cfe-commits mailing list