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

2021-03-26 Thread glenjofe at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96416 --- Comment #11 from Glen Joseph Fernandes --- > if it can never be used. You're misunderstanding. to_address(p) requires that pointer_traits is valid. It just doesn't need to have a to_address member function. Example 1. You have a

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

2021-03-26 Thread dangelog at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96416 --- Comment #10 from Giuseppe D'Angelo --- (By the way, finding this bug is quite hard. Could "address_of" be changed to "to_address" , in the bug description? I think that's the intended meaning. And, "to_pointer", mentioned a few times,

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

2021-03-26 Thread dangelog at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96416 Giuseppe D'Angelo changed: What|Removed |Added CC||dangelog at gmail dot com ---

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

2020-11-11 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96416 --- Comment #8 from Jonathan Wakely --- I suppose I could change the static_assert message to also suggest defining your own specialization of std::pointer_traits, which is another way to make it work.

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

2020-11-11 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96416 Jonathan Wakely changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

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

2020-11-11 Thread glenjofe at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96416 Glen Joseph Fernandes changed: What|Removed |Added CC||glenjofe at gmail dot com ---

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

2020-11-11 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96416 Jonathan Wakely changed: What|Removed |Added Status|ASSIGNED|NEW Assignee|redi at gcc

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

2020-11-11 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96416 --- Comment #5 from Jonathan Wakely --- But on third thoughts, I don't know how to implement this reliably.

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

2020-11-11 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96416 Jonathan Wakely changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |redi at gcc dot gnu.org

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

2020-08-03 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96416 --- Comment #3 from Jonathan Wakely --- Ugh, yes, I think we do.

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

2020-08-03 Thread whatwasthataddress at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96416 --- Comment #2 from Zach Laine --- Fair enough. [pointer.conversion] says that to_pointer(const Ptr& p) is "pointer_­traits​::​to_­address(p) if that expression is well-formed (see [pointer.traits.optmem]), otherwise

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

2020-08-03 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96416 --- Comment #1 from Jonathan Wakely --- I think this is the "correct" behaviour. The specification of pointer_traits::element_type says that if Ptr::element_type isn't valid, and Ptr isn't a template that can be "rebound", then "otherwise, the