https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115846
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Note here is a more reduced and easier to understand testcase (use a custom class ratehr than unique_ptr): ``` #include <optional> struct f { ~f(){} }; // static_assert([] { // f p; // non-constant condition for static assertion // return true; // }()); static_assert([] { std::optional<f> opt; opt.reset(); return true; }()); ```