https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88175
--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #3) > > string dummy; // for some reason this is needed to force the error to be > > shown as header.h:8:16: > > causes the struct to be a non-POD and the copy constructor to be created > differently. Right, when it says "in this function" it's referring to the copy constructor, because that's where the uninitialized value is used. That implicitly-defined copy constructor doesn't have a location (because it's not present in the source code) so it gets the location of the class definition, which is in the header.