https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80858
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to sgunderson from comment #0) > Using gcc version 7.1.0 (Debian 7.1.0-5) (but the error goes back to at > least 4.8, and amazingly, also in Clang), on this piece of code, simplified > from a much bigger test case: What error goes back to 4.8? As you say, it's correct that the code doesn't compile. Do you mean the fact that the error message isn't very clear, or something else? In practice it's quite difficult to check the copyability (which would be needed to produce a more helpful diagnostic) because it depends on the allocator as well as the value_type.