[PATCH] D119544: Deferred Concept Instantiation Implementation

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 6 06:37:30 PDT 2022

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.

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).



More information about the cfe-commits mailing list