Skip to content
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

[over.match.class.deduct] Wording does not seem to match intention CWG2681 #3898

Closed
cpplearner opened this issue Mar 25, 2020 · 2 comments · Fixed by #6118
Closed

[over.match.class.deduct] Wording does not seem to match intention CWG2681 #3898

cpplearner opened this issue Mar 25, 2020 · 2 comments · Fixed by #6118
Labels
decision-required A decision of the editorial group (or the Project Editor) is required.

Comments

@cpplearner
Copy link
Contributor

[over.match.class.deduct]/(1.8):

if ei is of array type and xi is a braced-init-list or string-literal, Ti is an rvalue reference to the declared type of ei

According to P2082R1, the intent is to permit

template<class T, std::size_t N>
struct A {
    T array[N];
};

A a2 = {"meow"}; // should deduce A<const char, 5>

However, since "meow" is an lvalue, and the parameter Ti is an rvalue reference, it seems that the deduction would fail, contrary to the expectation.

@jensmaurer jensmaurer added the decision-required A decision of the editorial group (or the Project Editor) is required. label Nov 6, 2020
@yuanfang-chen
Copy link

Agreed.

@yuanfang-chen
Copy link

This was accepted in wg21.link/cwg2681. This ticket could be closed.

@jensmaurer jensmaurer changed the title [over.match.class.deduct] Wording does not seem to match intention [over.match.class.deduct] Wording does not seem to match intention CWG2681 Jul 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
decision-required A decision of the editorial group (or the Project Editor) is required.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants