[Bug c++/34200] Two compilation units have same private class but no conflict detected or reported.

2007-11-22 Thread mat_geek at yahoo dot com dot au


--- Comment #2 from mat_geek at yahoo dot com dot au  2007-11-23 00:01 
---
Created an attachment (id=14618)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14618&action=view)
Example Code File 1


-- 


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



[Bug c++/34200] Two compilation units have same private class but no conflict detected or reported.

2007-11-22 Thread mat_geek at yahoo dot com dot au


--- Comment #3 from mat_geek at yahoo dot com dot au  2007-11-23 00:01 
---
Created an attachment (id=14619)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14619&action=view)
Example Code File 2


-- 


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



[Bug other/34200] New: Two compilation units have same private class but no conflict detected or reported.

2007-11-22 Thread mat_geek at yahoo dot com dot au
gcc (GCC) 4.1.2 (Ubuntu 4.1.2-0ubuntu4)

I had two c++ files with private classes and other public functions. I linked
them with a third unit of main code (using gcc command line). Now the linker
linked the second compilation unit to the private class in the first
compilation unit not to its private class. The conflict was not detected by GCC
but was detected by MSVC. It result in the program getting SEGV in weird and
incomprehensible ways. The fix was to wrap the private classes in anonymous
namespaces.

Please add detection for this sort of conflicting symbols.


To build compilation unit
g++  -g -O0  -I../../lib_content_adaptor/include CContentPluginExample.cpp -c
-o CContentPluginExample.o

To build executable
g++ -g -O0 -o drivable_plugin drivable_plugin.o CContentPluginExample.o
-L/usr/lib/debug/lib -L../../build/x86/libs -l_content_manager
-l_content_adaptor -l_os -lpthread


-- 
   Summary: Two compilation units have same private class but no
conflict detected  or reported.
   Product: gcc
   Version: 4.1.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: other
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mat_geek at yahoo dot com dot au


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



[Bug c++/34200] Two compilation units have same private class but no conflict detected or reported.

2007-11-22 Thread mat_geek at yahoo dot com dot au


--- Comment #6 from mat_geek at yahoo dot com dot au  2007-11-23 00:02 
---
Created an attachment (id=14622)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14622&action=view)
Example Code File Makefile


-- 


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



[Bug c++/34200] Two compilation units have same private class but no conflict detected or reported.

2007-11-22 Thread mat_geek at yahoo dot com dot au


--- Comment #5 from mat_geek at yahoo dot com dot au  2007-11-23 00:02 
---
Created an attachment (id=14621)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14621&action=view)
Example Code File Main


-- 


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



[Bug c++/34200] Two compilation units have same private class but no conflict detected or reported.

2007-11-22 Thread mat_geek at yahoo dot com dot au


--- Comment #4 from mat_geek at yahoo dot com dot au  2007-11-23 00:02 
---
Created an attachment (id=14620)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14620&action=view)
Example Code File 3


-- 


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



[Bug c++/34200] Two compilation units have same private class but no conflict detected or reported.

2007-11-22 Thread mat_geek at yahoo dot com dot au


--- Comment #7 from mat_geek at yahoo dot com dot au  2007-11-23 00:04 
---
The output from the example code is

514: [EMAIL PROTECTED] ~/temp/eg/ $> ./main.exec 
int main() in main.cpp at 14
void a() in a.cpp at 24
void A::f() in a.cpp at 13
void b() in b.cpp at 24
void B::f() in b.cpp at 13
void c() in c.cpp at 24
void B::f() in b.cpp at 13

It should have
void c() in c.cpp at 24
void B::f() in c.cpp at 13


-- 


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