[Bug c++/39513] class defined in file scope got linked by other files

2009-03-20 Thread pinskia at gcc dot gnu dot org
--- Comment #3 from pinskia at gcc dot gnu dot org 2009-03-20 20:56 --- This is hard to detect really because of inlining differences between translational units. See http://en.wikipedia.org/wiki/One_Definition_Rule -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39513

[Bug c++/39513] class defined in file scope got linked by other files

2009-03-20 Thread jengliang at gmail dot com
--- 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

[Bug c++/39513] class defined in file scope got linked by other files

2009-03-20 Thread pinskia at gcc dot gnu dot org
--- Comment #1 from pinskia at gcc dot gnu dot org 2009-03-20 20:44 --- 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. -- pinskia at gcc dot gnu dot org changed: