]> git.ipfire.org Git - thirdparty/gcc.git/commit - libstdc++-v3/ChangeLog
Make any_cast compare typeinfo as well as function pointers
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 23 May 2019 14:13:18 +0000 (14:13 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 23 May 2019 14:13:18 +0000 (14:13 +0000)
commit683f9728e8f54bff4b798dead54c5c4275079158
tree266886fa0da1ec2329d0dbbe73b11e45561df137
parent1db1e5ccca0d962558987bd1d87537e99f60e859
Make any_cast compare typeinfo as well as function pointers

It's possible for the function pointer comparison to fail even though
the type is correct, because the function could be defined multiple
times with different addresses when shared libraries are in use.

Retain the function pointer check for the common case where the check
succeeds, but compare typeinfo (if RTTI is enabled) if the first check
fails.

* include/experimental/any (__any_caster): Use RTTI if comparing
addresses fails, to support non-unique addresses in shared libraries.
* include/std/any (__any_caster): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@271557 138bc75d-0d04-0410-961f-82ee72b054a4
libstdc++-v3/ChangeLog
libstdc++-v3/include/experimental/any
libstdc++-v3/include/std/any