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

[temp.deduct.call] Deduction and qualification conversions with references #651

Open
t3nsor opened this issue Dec 11, 2024 · 0 comments
Open

Comments

@t3nsor
Copy link

t3nsor commented Dec 11, 2024

Full name of submitter: Brian Bi

Issue description: There is implementation divergence in the treatment of the following deduction:

#include <cstddef>

template <std::size_t N>
void f(const int* const (&)[N]);

int main() {
    int* a[3];
    f(a);
}

It is not clear whether bullet 4.1 of [temp.deduct.call] allows qualification conversions.

Suggested resolution: Edit [temp.deduct.call]/4.1 as follows:

If the original P is a reference type, the deduced A (i.e., the type referred to by the reference) can be more cv-qualified a type other than the transformed A that is reference-compatible ([dcl.init.ref]) with the transformed A.

(We might not need to say "transformed", actually. As far as I can tell, when the original P is a reference type, we transform A only in the case where P is a forwarding reference, and in that case no difference in cv-qualification is possible.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant