erichkeane added inline comments.

================
Comment at: clang/lib/Sema/SemaTemplateInstantiate.cpp:60-61
     const NamedDecl *D, const TemplateArgumentList *Innermost,
-    bool RelativeToPrimary, const FunctionDecl *Pattern) {
+    bool RelativeToPrimary, const FunctionDecl *Pattern, bool LookBeyondLambda,
+    bool IncludeContainingStructArgs) {
   // Accumulate the set of template argument lists in this structure.
----------------
ChuanqiXu wrote:
> Would you elaborate more for `LookBeyondLambda` and 
> `IncludeContainingStructArgs`? It confuses me since I couldn't find `Lambda` 
> or `Struct` from the context of use point.
Sure!  

So this function is typically used for 'getting the template instantiation 
args' of the current Declaration (D) for a variety of reasons.  In all of those 
cases previously, it would 'stop' looking when it hit a lambda generic call 
operator (see line 157).  This would block our ability to get the full 
instantiation tree.

Similarly, it would stop at a containing class-template (as most instantiations 
are done against the parent class template).  Unfortunately this is sufficient, 
so the IncludeContainingStructArgs (see line 185) ALSO includes those 
arguments, as they are necessary  (since they haven't been instantiated in the 
constraint yet).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119544/new/

https://reviews.llvm.org/D119544

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to