This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/18717] ODR and option -fmerge-templates
- From: "wolfgang dot roehrl at de dot gi-de dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Nov 2004 16:29:07 -0000
- Subject: [Bug c++/18717] ODR and option -fmerge-templates
- References: <20041129153300.18717.wolfgang.roehrl@de.gi-de.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From wolfgang dot roehrl at de dot gi-de dot com 2004-11-29 16:29 -------
Subject: Antwort: ODR and option -fmerge-templates
Hi all,
I'm responding to "Additional Comments From pinskia at gcc dot gnu dot org
2004-11-29 15:39":
It is clear that the compiler can't diagnose ODR violations across
translation units. If I don't use the compiler option -fmerge-templates in
the example which I posted the linker complains about "multiple definitions
of vtable of XXX". And this is a GOOD thing.
What I propose is only the following: The option -fmerge-templates should
not influence the location of the VTBLs - i.e. the VTBLs should allways be
located in the .rodata section as it is already the case if
-fmerge-templates is not switched on. And if the VTBLs are located in the
.rodata section the linker would not accept doubly defined VTBLs and the
kind of ODR violation which I described would be spotted independently of
the -fmerge-templates option.
I hope I have explained my point now a little bit clearer.
With kind regards,
W. Roehrl
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18717