https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93191

--- Comment #4 from Will Wray <wjwray at gmail dot com> ---
Reduced code for deduction of element type
for reference-to-array https://godbolt.org/z/tpkKjN:

    int f(auto(&a)[1]);
    int g(auto(&a)[ ]);

    int test_f = f("");
    int test_g = g(""); // error: no match for call

and same for pointer-to-array https://godbolt.org/z/dL9bGP

    int f(auto(*a)[1]);
    int g(auto(*a)[ ]);

    int test_f = f(&"");
    int test_g = g(&""); // error: no match for call

So, in both cases, ptr and ref, gcc currently deduces element type
if the bound is known but not with unknown bound.

My reading of http://eel.is/c++draft/temp.deduct.call#4 suggests that
only deduced *pointer* type is candidate for qualification conversion
(which should now allow the new conversion to unknown bound), whereas
deduced &reference& type can only be more cv qual'd than the source.

But then in [conv.qual] pointers and references are treated the same.

Any follow-up from CWG?

Reply via email to