C++ Logo

std-proposals

Advanced search

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

From: Thiago Macieira <thiago_at_[hidden]>
Date: Sat, 06 May 2023 10:17:32 -0700
On Saturday, 6 May 2023 03:07:01 PDT Giuseppe D'Angelo via Std-Proposals
wrote:
> On 06/05/2023 01:25, Thiago Macieira via Std-Proposals wrote:
> > What's the problem with:
> >
> > #if !__has_cpp_attribute(no_unique_address)
> > # error "Data layout would mismatch without [[no_unique_address]]; " \
> >
> > "please upgrade your compiler"
> >
> > #endif
>
> Does this work with modules?

Don't know, don't care, may have all sorts of other problems, and kind of has
to work by design.

Will compilers even allow using modules compiled by a future version of the
compiler? How will they cope with structural details they weren't aware of at
the time they were created? If they "cope" by rejecting said modules, then we
achieve the same result: you can't downgrade and lose features. If they will
"cope" by aborting the compilation and saying "you need to upgrade", then you
also achieve the same result. If they "cope" by generating broken code, then
you have bigger problems.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DCAI Cloud Engineering

Received on 2023-05-06 17:17:35