https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125514
Tomasz Kamiński <tkaminsk at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tkaminsk at gcc dot gnu.org
--- Comment #2 from Tomasz Kamiński <tkaminsk at gcc dot gnu.org> ---
> However, this is a diagnostic/build compatibility regression for existing
C++17 code. The user code only stores a std::reference_wrapper<const T> to a
forward-declared type.
That is incomplete type, and the computation of the nested types (result_type,
argument_type, first_argument_type) is producing different result. This is
ODR-violation,
and for the code that would SFINAE on their presence, may be non-benign. So, in
my perspective this warning indicates a real problem in user user code. The
only way to make that non-issue would be actually to remove them.
But, the presence (deprecated) of result_type, argument_type and
second_argument type is also compatibility feature, so removing them would be
cause for another regression.