[Bug c++/82035] GCC picks wrong template method instantiation if there are same name classes in independent compilation units

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Aug 30 15:55:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82035

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
You are violating the one definition rule of c++ with different definition of
Point.

In c++ types have linkage and which is why anonymous namespaces were added so
you get internal linkage for the translation units.

Gold linker has an odr violation detector and if you turn on gcc's lto gcc will
also detect this violation.

I can't remember if the sanitorizers have an odr violation detector or not.


More information about the Gcc-bugs mailing list