PR c++/94923 - False positive -Wclass-memaccess with trivially copyable std::optional
authorMartin Sebor <msebor@redhat.com>
Tue, 19 May 2020 18:46:37 +0000 (12:46 -0600)
committerMartin Sebor <msebor@redhat.com>
Tue, 19 May 2020 19:08:38 +0000 (13:08 -0600)
commitc0d8623ce5aa6d92c2e6c62e1bee66272a011f59
tree9a06c22b9fce1deb3cad47574a8bc3e1f5c3d4f8
parented63c387aa0bc1846082524455a6ff1fcec40f9d
PR c++/94923 - False positive -Wclass-memaccess with trivially copyable std::optional

gcc/cp/ChangeLog:

PR c++/94923
* call.c ((maybe_warn_class_memaccess): Use is_byte_access_type.
* cp-tree.h (is_dummy_object): Return bool.
(is_byte_access_type): Declare new function.
* tree.c (is_dummy_object): Return bool.
(is_byte_access_type): Define new function.

gcc/testsuite/ChangeLog:

PR c++/94923
* g++.dg/Wclass-memaccess.C: Add tests for std::byte.
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/cp-tree.h
gcc/cp/tree.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/Wclass-memaccess.C