C++ Logo

std-proposals

Advanced search

Re: [std-proposals] [Draft Proposal] Required attribute syntax

From: Tom Honermann <tom_at_[hidden]>
Date: Fri, 5 May 2023 10:48:51 -0400
On 5/4/23 3:47 PM, Jens Maurer via Std-Proposals wrote:
>
> On 04/05/2023 12.22, Lauri Vasama via Std-Proposals wrote:
>> The fact is that there are programs which behaviours depend on whether the implementation chooses to ignore this particular attribute or not.
> Such programs are broken (note ABI issues are out-of-scope for the C++ standard).
>
>> Perhaps that is fine, but perhaps not. As noted in the draft proposal, Microsoft has also been unwilling to implement [[no_unique_address]] in its ignorable form because it would cause an insidious ABI incompatibility depending on the language standard in use.
> That's not entirely accurate, it seems.
>
> https://devblogs.microsoft.com/cppblog/msvc-cpp20-and-the-std-cpp20-switch/
>
> says Microsoft is indeed worried about the ABI incompatibilites caused by
> starting to observe [[no_unique_address]], and
>
> "It was decided to hold-off on enabling the optimization for the [[no_unique_address]]
> attribute in the MSVC compiler until our next ABI breaking revision of the MSVC toolset,
> where it will be enabled across all language modes."
>
> That reads different than "unwilling to implement" to me.

Indeed, and they were sufficiently motivated to introduce
[[msvc::no_unique_address]] as an option for those that have control
over all the toolchains used to compile all the source files that
contribute to their build.

Tom.

>
> Jens

Received on 2023-05-05 14:48:54