diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2022-10-18 20:49:42 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2022-10-21 10:40:40 +0100 |
commit | 33de0ffcf050e581eb931eb4f1c5ad9c0cdc6bf6 (patch) | |
tree | f57b15a4b3aea8925819c9786512c1deaa74b085 /gcc/cppmain.c | |
parent | a9de836c2b22f878cff592b96e11c1b95d4d36ee (diff) | |
download | gcc-33de0ffcf050e581eb931eb4f1c5ad9c0cdc6bf6.zip gcc-33de0ffcf050e581eb931eb4f1c5ad9c0cdc6bf6.tar.gz gcc-33de0ffcf050e581eb931eb4f1c5ad9c0cdc6bf6.tar.bz2 |
libstdc++: Fix std::move_only_function for incomplete parameter types
The std::move_only_function::__param_t alias template attempts to
optimize argument passing for the invoker, by passing by rvalue
reference for types that are non-trivial or large. However, the
precondition for is_trivally_copyable makes it unsuitable for using
here, and can cause ODR violations. Just use is_scalar instead, and pass
all class types (even small, trivial ones) by value.
libstdc++-v3/ChangeLog:
* include/bits/mofunc_impl.h (move_only_function::__param_t):
Use __is_scalar instead of is_trivially_copyable.
* testsuite/20_util/move_only_function/call.cc: Check parameters
involving incomplete types.
Diffstat (limited to 'gcc/cppmain.c')
0 files changed, 0 insertions, 0 deletions