[Bug libstdc++/96416] to_address() is broken by static_assert in pointer_traits

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Apr 20 20:11:24 GMT 2021


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

--- Comment #17 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Giuseppe D'Angelo from comment #14)
> To summarize:
> 
> * should a wording defect be raised against std::to_address(Ptr), to state
> that pointer_traits<Ptr> being well-formed is actually a prerequisite?

I'd prefer if pointer_traits was just SFINAE friendly.

> * should LWG3446's resolution be amended?

See https://cplusplus.github.io/LWG/issue3541

> * if there's going to be a GCC 10.3, is the commit above solving LWG3446
> going to be cherry-picked into it? Otherwise, either one blacklists GCC 10,
> or has to specialize pointer_traits there as a workaround (?).

It missed the 10.3 release, but it's on the gcc-10 branch as r10-9698, which
will be in GCC 10.4:
https://gcc.gnu.org/g:32a859531e854382c18abf0b14a306d83f793eb5
That also includes the fix for LWG 3541.


More information about the Gcc-bugs mailing list