[Bug c++/18717] ODR and option -fmerge-templates
wolfgang dot roehrl at de dot gi-de dot com
gcc-bugzilla@gcc.gnu.org
Mon Nov 29 16:29:00 GMT 2004
------- 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
More information about the Gcc-bugs
mailing list