]> git.ipfire.org Git - thirdparty/gcc.git/commit
c+: -Wabi false positive [PR120012]
authorJason Merrill <jason@redhat.com>
Mon, 12 May 2025 15:53:03 +0000 (11:53 -0400)
committerJason Merrill <jason@redhat.com>
Mon, 12 May 2025 19:43:03 +0000 (15:43 -0400)
commitb4b4dfbd22e06877052bd4cc4b191d9d138155cf
treeb6fabab4a6384d1c709e6ae879e7ac1d1bf34523
parent17c272598564d7a4f3bfc86b52e4b91b50f98e1d
c+: -Wabi false positive [PR120012]

The warning compares the position of a field depending on whether or not the
previous base/field is considered a POD for layout, but failed to consider
whether the previous base/field is empty; layout of an empty base doesn't
consider PODness.

PR c++/120012

gcc/cp/ChangeLog:

* class.cc (check_non_pod_aggregate): Check is_empty_class.

gcc/testsuite/ChangeLog:

* g++.dg/abi/base-defaulted2.C: New test.
gcc/cp/class.cc
gcc/testsuite/g++.dg/abi/base-defaulted2.C [new file with mode: 0644]