This is an archive of the discontinued LLVM Phabricator instance.

clang: perform deduction at the right depth on Sema::AddMethodTemplateCandidate
Changes PlannedPublic

Authored by mizvekov on Jun 21 2022, 7:00 AM.

Details

Reviewers
rsmith
Summary

Fixes PR28087.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>

Diff Detail

Event Timeline

mizvekov created this revision.Jun 21 2022, 7:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 21 2022, 7:00 AM
mizvekov published this revision for review.Jun 21 2022, 12:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 21 2022, 12:29 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
mizvekov added a subscriber: v.g.vassilev.
mizvekov updated this revision to Diff 445370.Jul 17 2022, 6:51 PM
mizvekov edited the summary of this revision. (Show Details)
shafik added a subscriber: shafik.Jul 18 2022, 9:35 PM
shafik added inline comments.
clang/lib/Sema/SemaOverload.cpp
14176

Do we have a test for this case?

mizvekov planned changes to this revision.Jul 19 2022, 6:32 PM
mizvekov added inline comments.
clang/lib/Sema/SemaOverload.cpp
14176

The test included hits it, but after a second look I realized this wasn't supposed to happen in the first place.
We are missing something else to make this fully work, I think we are not expanding across that nested function template.

Test case: https://godbolt.org/z/qq4rTfK9x

template <class...> struct S {
  template <int> auto f(decltype([](int...) {}()));
};
template struct S<>;

GCC compiles this, clang doesn't, because it thinks that lambda has 1 parameter.

I will take this patch out for changes, I probably won't have time to go back to it anytime soon because I have other patches with more priority.