[PATCH] D20192: [Sema] Fix bug to do with lookup of template friend function in namespace

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Mon May 23 13:31:56 PDT 2016


rsmith added a comment.

It sounds like we're failing to properly inherit default template arguments onto redeclarations generated by template instantiation, resulting in a violation of our AST invariants. This patch will hide the problem in some cases, but the right thing to do is to fix the root cause: we should call CheckTemplateParameterList to inherit the default template arguments when instantiating a function template declaration. (Note that `TemplateDeclInstantiator::VisitClassTemplateDecl` remembers to do this but `TemplateDeclInstantiator::VisitFunctionTemplateDecl` forgets -- as does our handling for variable templates, and for partial specializations of class templates and variable templates.)


http://reviews.llvm.org/D20192





More information about the cfe-commits mailing list