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

--- Comment #3 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Here's a much simpler testcase in terms of std::optional directly:

#include <optional>

constexpr auto f() {
  std::optional<int> result = 1;
  result = std::nullopt;
  return result;
}

constexpr auto v = f();

Interesingly Clang also rejects this one (complaining about uninitialized
_M_value subobject), but it seems clearly valid?

Reply via email to