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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW

--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
(In reply to Will Wray from comment #4)
> Any follow-up from CWG?

Yes, thanks to Richard Smith.  Regarding

int g(auto(&a)[]);
int test_g = g("");

int f(auto(*a)[]);
int test_f = f(&"");

"I think the wording has a bug here, in the reference case.

The 'f' case appears to be valid: per [temp.deduct.call]/4.2, "The
transformed A can be a[nother] pointer or pointer-to-member type that can
be converted to the deduced A via a function pointer conversion (7.3.13)
and/or qualification conversion (7.3.5)." (Aside: why "another"?)

The 'g' case *should* be valid, but [temp.deduct.call]/4.1 says only "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 than the transformed A."

... which doesn't cover this kind of qualification conversion. We should
presumably allow anything reference-compatible, not only "more
cv-qualified" cases. (We'd need to be careful to make the reference part of
/4.3, which is the other reference-compatible case, still work properly.)"

So, confirmed, but I think it's GCC 11 material.

Reply via email to