https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87905
--- Comment #4 from Raymond Jennings <shentino at gmail dot com> --- (In reply to Martin Liška from comment #2) > > > > Note in the test package that neither struct is exposed to the other > > translation unit. > > But it's violation of C++ ODR and as LTO compilation unit is entire program, > you then introduce violation. I respectfully disagree. Unless the source code itself changes, toggling LTO shouldn't affect generated warnings. It may be one /compilation/ unit, but by the standard they still count as separate translation units. LTO is an artifact of the compiler and not the standard so it shouldn't have an impact on ODR warnings.