https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61549
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- You are violating the one-definition-rule (ODR) of C++. It's undefined if two same classes have different implementations. Put them in anonymous namespaces and it'll work.