C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Relocation in C++

From: Timur Doumler <cpp_at_[hidden]>
Date: Tue, 20 Dec 2022 13:25:48 +0000



> On 19 Dec 2022, at 12:11, Bo Persson via Std-Proposals <std-proposals_at_[hidden]> wrote:
> At least originally, there was a basic idea that ignoring an attribute should not affect the validity of a program. Like [[nodiscard]] and [[maybe_unused]] would affect warnings, but not the generated code.
>
> Adding ABI-modifying attributes seems to be totally contrary to this.

That basic idea has been thrown out of the window a while ago. We now have multiple potentially-ABI-modifying attributes in the standard.

[[no_unique_address]] modifies ABI: its purpose is to literally change the class layout.

[[assume]] can also modify ABI in one particular edge case (https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2552r1.pdf, see last code example on page 5).

Cheers,
Timur

Received on 2022-12-20 13:27:25