https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104760
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> --- Libstdc++ has the attribute on both of these templates. I used diagnostic pragmas to stop the function templates from warning about the use of the class templates. If other code refers to either of them, it gets a warning. But the use of unary_negate within std::not1 doesn't give a warning.