googletest
googletest copied to clipboard
exclude tuple-like types from OnceAction forwarding constructors
trafficstars
Fixes https://github.com/google/googletest/issues/3947
Problem
OnceActionhas templated forwarding constructors constrained for callable types.- On QNX SDK versions prior to 8.0,
std::tuple<OnceAction>can incorrectly satisfy those constraints because of how that libc++ implementsstd::tupleconverting constructors. - Upstream, most libc++/libstdc++/MSVC versions short-circuit correctly, so the bug is only visible on QNX. But nothing about
OnceActionshould ever allow a tuple to be treated as a callable. - Note existence of QNX downstream patch to achieve the same thing at https://github.com/qnx/googletest/commit/ceebbad256fef7541ab5432d1730427827171cc9#diff-91a00bafe0b6186545af81d16fdc9a5fd0afccfc336bdbbcab5deb7de63a57f6L475
Solution
- Update
OnceActionforwarding constructors to exclude tuple-like types.