https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124910
--- Comment #16 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Patrick Palka <[email protected]>: https://gcc.gnu.org/g:d92712cdcb19a8e0c6668880b2443a3a18d983da commit r16-8777-gd92712cdcb19a8e0c6668880b2443a3a18d983da Author: Patrick Palka <[email protected]> Date: Tue Apr 21 09:33:50 2026 -0400 libstdc++: Restrict engaged -> disengaged std::optional fix [PR124910] It turns out a union without an active member does not violate C++20 core constant expression rules and r16-8748 was really just a workaround for a front end bug. The actual underlying problem -- that the constexpr evaluator treated an explicitly destroyed union member as still active -- has been fixed by r16-8767 which makes this workaround unnecessary for GCC. Rather than remove the workaround, restrict it to Clang which seems to have a similar bug making it still needed for e.g. the r16-8748 testcase. PR c++/124910 libstdc++-v3/ChangeLog: * include/std/optional (_Optional_payload_base::_M_destroy): Restrict r16-8748 workaround to Clang, and adjust comment. Reviewed-by: Jonathan Wakely <[email protected]>
