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
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
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.
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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102090
Andrew Pinski changed:
What|Removed |Added
Resolution|--- |INVALID
Status|UNCONFIRMED
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
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*.
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
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.