-fvisibility=hidden vs. typeinfo
Jonathan Wakely
jwakely.gcc@gmail.com
Mon Jun 29 09:33:00 GMT 2015
On 29 June 2015 at 09:58, Avi Kivity wrote:
> I have some code that looks like
>
> void some_function() throw (std::out_of_range) {
> ... call to std::map<>::at() which throws out_out_range
> }
>
> if I compile with -fvisibility=hidden, this code calls terminate(). My
> suspicion is that I ended up with two copies of the typeinfo block for
> std::out_of_range; one used by std::__throw_out_of_range() in libstdc++, and
> another in the guard code generated by the compiler. Since they don't
> match, the guard block terminates.
>
> Is this correct? If so, is this a bug in libstdc++, or the compiler (or the
> linker)? If not, what can I do to fix this?
>
> I wasn't able to generate a self contained test case quickly, but if there's
> no other way, I'll invest more effort into it.
I think this is supposed to work, because type matching should be done
using typeinfo names not just the identity of the typeinfo obejcts.
More information about the Gcc-help
mailing list