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

--- Comment #10 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #7)
> r11-3612-g4f4ced28826ece replaced the former use of
> DECL_IS_REPLACEABLE_OPERATOR_DELETE_P with DECL_IS_OPERATOR_DELETE_P
> (throughout the code base).  Jason, what's this about?

That change was primarily to clarify that CALL_FROM_NEW_OR_DELETE_P is about
whether the call results from a syntactic new or delete expression, not about
what function gets called.  

And also, the rule (https://eel.is/c++draft/expr.delete#6) about omitting a
call to op delete does not depend on whether the operator is replaceable, like
the corresponding rule for new does (https://eel.is/c++draft/expr.new#14).  The
rule for delete depends only on whether the corresponding new was omitted.

But perhaps that's not the rule that the find_func_aliases_for_call is about,
so changing it in that commit was wrong.  Perhaps this spot is meant to
parallel the handling in gimple_call_fnspec, so it should use the same
condition (including checking flag_assume_sane...)?

> I suppose DECL_IS_REPLACEABLE_OPERATOR will just never be set on delete?

It is set in cxx_build_operator_delete.

Reply via email to