[Bug libstdc++/102090] Placement-new is not constexpr

2021-08-27 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102090 --- Comment #9 from Jakub Jelinek --- One of the reasons might be that placement new returns void *, and cast of that to pointer to some other type is not valid in constant expressions. std::construct_at bypasses all of that just by being a magi

[Bug libstdc++/102090] Placement-new is not constexpr

2021-08-27 Thread friedkeenan at protonmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102090 --- Comment #8 from friedkeenan at protonmail dot com --- Sorry for wasting your time with this bug report. It just didn't make sense to me why placement-new couldn't be constexpr

[Bug libstdc++/102090] Placement-new is not constexpr

2021-08-27 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102090 --- Comment #7 from Jakub Jelinek --- http://eel.is/c++draft/new.syn doesn't say placement new should be constexpr.

[Bug libstdc++/102090] Placement-new is not constexpr

2021-08-27 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102090 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #6

[Bug libstdc++/102090] Placement-new is not constexpr

2021-08-26 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102090 Andrew Pinski changed: What|Removed |Added Resolution|--- |INVALID Status|UNCONFIRMED

[Bug libstdc++/102090] Placement-new is not constexpr

2021-08-26 Thread friedkeenan at protonmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102090 --- Comment #4 from friedkeenan at protonmail dot com --- I think you're correct. That's really strange, but I guess that's what std::construct_at is for? But that also confuses me, how is GCC's implementation of std::construct_at working if plac

[Bug libstdc++/102090] Placement-new is not constexpr

2021-08-26 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102090 --- Comment #3 from Andrew Pinski --- DR 1312 also mentions something similar with respect to casting to void*.

[Bug libstdc++/102090] Placement-new is not constexpr

2021-08-26 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102090 --- Comment #2 from Andrew Pinski --- clang produces: :3:16: error: consteval function never produces a constant expression [-Winvalid-constexpr] consteval auto fuck() { ^ :5:23: note: call to placement 'operator new' const a

[Bug libstdc++/102090] Placement-new is not constexpr

2021-08-26 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102090 --- Comment #1 from Andrew Pinski --- I don't think inplacement new is valid for constexpr. See PR 61105 also.