This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/21405] New: Template inlines have global visibility
- From: "mike at navi dot cx" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 May 2005 21:49:36 -0000
- Subject: [Bug c++/21405] New: Template inlines have global visibility
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
See http://gcc.gnu.org/ml/libstdc++/2005-04/msg00173.html
If you have code like:
std::string b = "bee";
std::string c = "see";
std::string a = b + c;
Then the string + operator overload will appear in the final ELF image with
GLOBAL WEAK visibility, meaning it can be bound to the wrong version of the
symbol at runtime (ie symbol versioning is ignored).
This is serious as it means you can't mix libraries that use different C++ ABIs
into the same image even if they only interact via C ABIs, something that the
GCC docs explicitly say will work!
--
Summary: Template inlines have global visibility
Product: gcc
Version: 3.4.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mike at navi dot cx
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21405