This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/50455] duplicate class/constructor silently accepted, wrong constructor linked


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50455

--- Comment #8 from eda-qa at disemia dot com 2011-09-19 12:53:33 UTC ---
I agree that this is a violation of the ODR. I agree this might be difficult
for the linker to detect.

However for a user this is a serious problem that can be very hard to determine
without the help of the tool chain. Consider that in my original project the
duplicate definition was in some other library in the automake setup. This
implies that linking with *any* external library/object can introduce this
error into your project without any compiler/linker diagnostic.

I would suspect an average user would expect a "duplicate symbol" error for
this type of error.  Otherwise this makes it unsafe to add new classes to any
C++ library, ever: any new class may silently replace the constructor of some
class by the user of the library.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]