aboutsummaryrefslogtreecommitdiff
path: root/gcc/rtl.c
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2019-04-24 16:17:43 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2019-04-24 16:17:43 +0100
commit92750002ef200965cb33aa5af68676b540564758 (patch)
treefa0e6eb0d5e98c5c22274cde7daca42c26449e3c /gcc/rtl.c
parent540bc8a8b1ff0aeb19ba6ac6304dd2e2075412c7 (diff)
downloadgcc-92750002ef200965cb33aa5af68676b540564758.zip
gcc-92750002ef200965cb33aa5af68676b540564758.tar.gz
gcc-92750002ef200965cb33aa5af68676b540564758.tar.bz2
PR libstdc++/90220 Fix std::any_cast for array types
Although the std::any constructors use decay_t to determine the type of the contained value, std::any_cast should use the un-decayed type (and so always fail for function and array types that decay to pointers). Using remove_cv_t is correct, because the condition for std::any_cast to return non-null is operand.type() == typeid(T) and typeid ignores top-level cv-qualifiers. PR libstdc++/90220 * include/std/any (__any_caster): Use remove_cv_t instead of decay_t. Avoid a runtime check for types that can never be stored in std::any. * testsuite/20_util/any/misc/any_cast.cc: Test std::any_cast with array types. From-SVN: r270547
Diffstat (limited to 'gcc/rtl.c')
0 files changed, 0 insertions, 0 deletions