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

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jul 10 08:55:57 GMT 2024


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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #11 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I don't see a problem here, and I don't see why we should change anything when
the code works fine.

During constant evaluation, if nothing gets destroyed then the destructor is
not needed. So it's irrelevant whether it's constexpr or not.


More information about the Gcc-bugs mailing list