[Bug libstdc++/93479] compare_three_way allows comparing arrays

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jan 28 22:46:00 GMT 2020


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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Barry Revzin from comment #0)
> The check for __3way_builtin_ptr_cmp needs to reject arrays, since the
> expression declval<T>() <=> declval<U>() does not resolve to a built-in
> operator comparing pointers (it doesn't resolve to any operator).

I think it should require declval<T>() <=> declval<U>() to be valid. I forgot
to actually check that.


More information about the Gcc-bugs mailing list