https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106072
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org --- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> --- No, that is not the problem. The problem is solely in the: return AST::ClosureParam (std::move (pattern), pattern->get_locus (), std::move (type), std::move (outer_attrs)); line. pattern is a unique_ptr, std::move (pattern) will: _GLIBCXX23_CONSTEXPR __uniq_ptr_impl(__uniq_ptr_impl&& __u) noexcept : _M_t(std::move(__u._M_t)) { __u._M_ptr() = nullptr; } and so once std::move (pattern) is done, pattern is nullptr. And then it calls pattern->get_locus (), already on the nullptr.