https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67094
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- That -x c++ with .o files are being treated as c++ source and being compiled and that is what is the error message is saying. The .o file is a binary file.