[Bug libstdc++/115846] std::optional<std::unique_ptr<int>> is constant expression even in C++20 mode

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jul 9 17:41:15 GMT 2024


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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
My reading of the paper makes me think this is a libc++ bug because even though
std::unique_ptr<int> is not constexpr std::optional<std::unique_ptr<int>> is
still if there was optional (value) is not set/use.

Especially since std::optional<std::unique_ptr<int>>::reset is constexpr there.

Now I could be reading the paper incorrectly and even std::optional part in
general incorrectly.


More information about the Gcc-bugs mailing list