[PATCH] D80743: (PR46111) Desugar Elaborated types in Deduction Guides.

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 4 11:00:22 PDT 2020


erichkeane updated this revision to Diff 268524.
erichkeane added a comment.

@rsmith I think this implements what you've suggested? I'm struggling a little with the template instantiations here, I'm not terribly sure I understand them as well as I'd hope.

This seems to 'work' for a small subset of works, but it doesn't properly register the typedef to the LocalInstantiationScope, so the normal template instantiation (like here https://github.com/llvm/llvm-project/blob/master/clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp#L156) ends up hitting the 'findInstantiationOf' assert here: https://github.com/llvm/llvm-project/blob/master/clang/lib/Sema/SemaTemplateInstantiate.cpp#L3564

I can see the parameter itself with the correct type being registered here: https://github.com/llvm/llvm-project/blob/master/clang/lib/Sema/SemaTemplate.cpp#L2249

But I don't have a good idea on how I'm supposed to do this with the typedef.  Since it is a materialized typedef, it doesn't seem like we have the 'old' decl to register, nor access to the LocalInstantiationScope.

Can you make a suggestion?  Am I missing something simple, or did I just not do what you suggested?  If thats the case, can you rephrase your thought?

Thanks!
-Erich


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

https://reviews.llvm.org/D80743

Files:
  clang/lib/Sema/SemaTemplate.cpp
  clang/test/AST/deduction-guides.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80743.268524.patch
Type: text/x-patch
Size: 7042 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200604/30cd794f/attachment.bin>


More information about the cfe-commits mailing list