[PATCH] D116983: Clone constructor template parameters when creating deduction guide

Arthur Eubanks via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 12 17:04:31 PST 2022


aeubanks added inline comments.


================
Comment at: clang/lib/Sema/SemaTemplate.cpp:2174
+      Args.addOuterTemplateArguments(SubstArgs);
+      Args.addOuterRetainedLevel();
+      NamedDecl *NewParam = transformTemplateParameter(Param, Args);
----------------
rsmith wrote:
> This outer retained level would correspond to the parameters you're building -- we shouldn't add this. Instead, we should have two different `SubstArgs` lists, one for the outer parameters and one for the inner parameters; we should add just the outer parameters here, and add the inner and outer parameters below. (And at the end of each iteration of this loop we should accumulate arguments onto the outer arguments list like we accumulate arguments onto the inner arguments list in the next loop.)
I think this is what you're referring to? I still don't understand exactly what `Args.addOuterRetainedLevel()` does, and the current draft doesn't fix the modules crash.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116983



More information about the cfe-commits mailing list