This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/23628] Typeinfo comparison code easily breaks shared libs
- From: "mmarcus at emarcus dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Aug 2005 20:23:46 -0000
- Subject: [Bug c++/23628] Typeinfo comparison code easily breaks shared libs
- References: <20050829194742.23628.mmarcus@emarcus.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From mmarcus at emarcus dot org 2005-08-29 20:23 -------
Actually, I'll just paste the darwin test case here. On this platform, libstdc++
is a sharedlib. The following code:
###
#include <vector>
#include <iostream>
#include <stdexcept>
int main (int argc, char * const argv[]) {
std::vector<int> v;
try {
v.at(1);
}
catch(const std::out_of_range& e) {
std::cout << "Correct behavior: out of range caught, what==: " <<
e.what() << "\n";
throw;
}
catch(...) {
std::cout << "Oops, apparent problem with type identity across a DLL
boundary\n";
throw;
}
return 0;
}
###
Output is the "Oops case" when built without explictly setting
-fvisibility=default or -fvisibility-inlines-hidden for the "hosting" exectuable.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |NEW
Ever Confirmed| |1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23628