[Bug c++/39513] class defined in file scope got linked by other files
jengliang at gmail dot com
gcc-bugzilla@gcc.gnu.org
Fri Mar 20 20:53:00 GMT 2009
------- Comment #2 from jengliang at gmail dot com 2009-03-20 20:52 -------
(In reply to comment #1)
> You are violating C++'s One definition rule (ODR). This code is undefined
> because the definition of A::A() (and others) are different between the two
> files.
Thanks for the quick response and sorry about the spam... It would be nice if
gcc can detect such violations though. In large software team, this is bound
to happen and we learned it the hard way.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39513
More information about the Gcc-bugs
mailing list