[Bug c++/31300] undetected class name clash

2007-03-26 Thread thierry dot galas at med dot ge dot com
--- Comment #8 from thierry dot galas at med dot ge dot com 2007-03-26 13:56 --- Subject: Re: undetected class name clash Thanks for the explanation, I agree that it is hard to detect for a compiler to detect ODL violation, especially if we want to exclude from ODL local classes

[Bug c++/31300] undetected class name clash

2007-03-26 Thread bangerth at dealii dot org
--- Comment #9 from bangerth at dealii dot org 2007-03-26 15:17 --- (In reply to comment #8) but I guess it could be possible at link time, as it is already the case for C symbols. We also don't do that in C: if you have two functions of the same name defined in two different .c

[Bug c++/31300] undetected class name clash

2007-03-22 Thread bangerth at dealii dot org
--- Comment #7 from bangerth at dealii dot org 2007-03-23 02:13 --- (In reply to comment #4) I agree , sure it is invalid ,(no mine at the root) but a diagnostic would be nice It is very hard for a compiler to detect this because it only sees that there is a class 'T'. The compiler

[Bug c++/31300] undetected class name clash

2007-03-21 Thread thierry dot galas at med dot ge dot com
--- Comment #1 from thierry dot galas at med dot ge dot com 2007-03-21 17:50 --- Created an attachment (id=13245) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13245action=view) very short code showing the issue in a tar file --

[Bug c++/31300] undetected class name clash

2007-03-21 Thread thierry dot galas at med dot ge dot com
--- Comment #2 from thierry dot galas at med dot ge dot com 2007-03-21 17:52 --- samething with gcc : version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31300

[Bug c++/31300] undetected class name clash

2007-03-21 Thread pinskia at gcc dot gnu dot org
--- Comment #3 from pinskia at gcc dot gnu dot org 2007-03-21 17:53 --- They are not local, if you want to declare local classes to a file use an anonymous namespace. This code is invalid but no diagnostic is required by the C++ standard (it violates the One definition rule). --

[Bug c++/31300] undetected class name clash

2007-03-21 Thread thierry dot galas at med dot ge dot com
--- Comment #4 from thierry dot galas at med dot ge dot com 2007-03-21 18:16 --- Subject: Re: undetected class name clash I agree , sure it is invalid ,(no mine at the root) but a diagnostic would be nice very difficult to decide people to use c++ , if this kind of issue is not

[Bug c++/31300] undetected class name clash

2007-03-21 Thread pinskia at gcc dot gnu dot org
--- Comment #5 from pinskia at gcc dot gnu dot org 2007-03-21 18:26 --- The only way to get a diagnostic is to output the class definition and even then sometimes the detection could be wrong. ODR reporting is a hard problem with most code. --

[Bug c++/31300] undetected class name clash

2007-03-21 Thread thierry dot galas at med dot ge dot com
--- Comment #6 from thierry dot galas at med dot ge dot com 2007-03-21 18:33 --- Subject: Re: undetected class name clash Thanks for the anonymous namespace suggestion (I didn't know about it before) , it is efficient and could be systematized at the scale of a large team.