This is an archive of the discontinued LLVM Phabricator instance.

Clone constructor template parameters when creating deduction guide
Needs ReviewPublic

Authored by aeubanks on Jan 10 2022, 5:12 PM.

Details

Reviewers
rsmith

Diff Detail

Event Timeline

aeubanks created this revision.Jan 10 2022, 5:12 PM
rsmith added a subscriber: rsmith.Jan 11 2022, 11:59 AM
rsmith added inline comments.
clang/lib/Sema/SemaTemplate.cpp
2174

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

aeubanks published this revision for review.Jan 12 2022, 4:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 12 2022, 4:59 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
aeubanks added inline comments.Jan 12 2022, 5:04 PM
clang/lib/Sema/SemaTemplate.cpp
2174

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.

rsmith added inline comments.Jan 12 2022, 6:52 PM
clang/lib/Sema/SemaTemplate.cpp
2174

I found a few more places that need to be adjusted. Here's where I got to: https://github.com/zygoloid/llvm-project/commit/fffb4b688eb5a91bc2aca673773bc2da018f3dba (this is on top of the earlier version of this patch, though).

There are still some test failures there, so I think some more updates are still needed. We also need to do the same cloning process in buildSimpleDeductionGuide, which I think is why the modules unit test is still failing.