diff options
author | Jason Merrill <jason@redhat.com> | 2022-01-21 11:16:49 -0500 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2022-01-21 12:06:18 -0500 |
commit | 23be9f83bbd2c6f03580757adbfe599de6bf702b (patch) | |
tree | 93937d4a30606234ded38f014574e638855c8354 /gcc/cp/class.cc | |
parent | 45cae5b6392496028f35c5948f7fae0af81d135b (diff) | |
download | gcc-23be9f83bbd2c6f03580757adbfe599de6bf702b.zip gcc-23be9f83bbd2c6f03580757adbfe599de6bf702b.tar.gz gcc-23be9f83bbd2c6f03580757adbfe599de6bf702b.tar.bz2 |
c++: [[no_unique_address]] and virtual base [PR104139]
Fixing a thinko in my patch for 103681: when computing the size of a virtual
base, it would help to use its binfo instead of the one for the derived
class.
PR c++/104139
PR c++/103681
gcc/cp/ChangeLog:
* class.cc (end_of_class): Use base_binfo.
gcc/testsuite/ChangeLog:
* g++.dg/abi/no_unique_address2.C: Adjust to detect this on x86-64.
Diffstat (limited to 'gcc/cp/class.cc')
-rw-r--r-- | gcc/cp/class.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/cp/class.cc b/gcc/cp/class.cc index e5cc6f1..5db3722 100644 --- a/gcc/cp/class.cc +++ b/gcc/cp/class.cc @@ -6414,8 +6414,8 @@ end_of_class (tree t, eoc_mode mode) { if (mode == eoc_nv_or_dsize) /* For dsize, don't count trailing empty bases. */ - offset = size_binop (PLUS_EXPR, BINFO_OFFSET (binfo), - CLASSTYPE_SIZE_UNIT (BINFO_TYPE (binfo))); + offset = size_binop (PLUS_EXPR, BINFO_OFFSET (base_binfo), + CLASSTYPE_SIZE_UNIT (BINFO_TYPE (base_binfo))); else offset = end_of_base (base_binfo); if (tree_int_cst_lt (result, offset)) |