Skip to content

Clang++ fails to match template template parameters as function arguments #111363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
PiliLatiesa opened this issue Oct 7, 2024 · 4 comments · Fixed by #111457
Closed

Clang++ fails to match template template parameters as function arguments #111363

PiliLatiesa opened this issue Oct 7, 2024 · 4 comments · Fixed by #111457
Assignees
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" confirmed Verified by a second party regression:19 Regression in 19 release

Comments

@PiliLatiesa
Copy link

Clang++ trunk started rejecting the following testcase (adapted from https://eel.is/c++draft/temp#arg.template-example-3). Clang 19 accepts it. It's a recent regression.

template <template <class, class...> class TT, class T1, class... Rest>
void f(TT<T1, Rest...> const &) {}

template <typename T1> struct A {};

int main()
{ 
  A<int> a;
  f(a);   // bogus "no matching function for call to 'f'"
}
@github-actions github-actions bot added the clang Clang issues not falling into any other category label Oct 7, 2024
@zyn0217 zyn0217 added clang:frontend Language frontend issues, e.g. anything involving "Sema" regression:19 Regression in 19 release and removed clang Clang issues not falling into any other category labels Oct 7, 2024
@llvmbot
Copy link
Member

llvmbot commented Oct 7, 2024

@llvm/issue-subscribers-clang-frontend

Author: None (PiliLatiesa)

Clang++ trunk started rejecting the following testcase (adapted from https://eel.is/c++draft/temp#arg.template-example-3). Clang 19 accepts it. It's a recent regression.
template &lt;template &lt;class, class...&gt; class TT, class T1, class... Rest&gt;
void f(TT&lt;T1, Rest...&gt; const &amp;) {}

template &lt;typename T1&gt; struct A {};

int main()
{ 
  A&lt;int&gt; a;
  f(a);   // bogus "no matching function for call to 'f'"
}

@zyn0217
Copy link
Contributor

zyn0217 commented Oct 7, 2024

@mizvekov Is it also related to #96023?

@cor3ntin
Copy link
Contributor

cor3ntin commented Oct 7, 2024

Yes #96023 (comment)

@mizvekov
Copy link
Contributor

mizvekov commented Oct 8, 2024

This will be fixed by #111457

@mizvekov mizvekov self-assigned this Oct 8, 2024
zmodem added a commit that referenced this issue Oct 9, 2024
This caused Clang to reject valid code, see discussion on the PR
#96023 (comment)
and #111363

This reverts commit 6afe567 and
follow-up commit 9abb97f.
DanielCChen pushed a commit to DanielCChen/llvm-project that referenced this issue Oct 16, 2024
…te calls. (llvm#111457)

Clang previously missed implementing P0522 pack matching for deduced
function template calls.

Fixes llvm#111363
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" confirmed Verified by a second party regression:19 Regression in 19 release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants