https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92986
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- The compiler doesn't see both TUs at the same time, so how could it warn? The standard certainly doesn't require diagnostics for this. Even if the compiler sees both, such as with -flto, it will warn with -Wodr about cases where e.g. classes have the same name and different content, but it can't really check whether the content of the methods is the same - at the point where the bodies are streamed they are through several optimization passes and so quite impossible to detect if they originally were the same (they could be built with different optimization options ...).