C++ Logo

std-proposals

Advanced search

Re: [std-proposals] unimplemented attribute

From: Hans Åberg <haberg_1_at_[hidden]>
Date: Thu, 20 Mar 2025 10:54:36 +0100
> On 19 Mar 2025, at 19:29, Thiago Macieira via Std-Proposals <std-proposals_at_[hidden]> wrote:
>
> On Wednesday, 19 March 2025 09:48:29 Pacific Daylight Time Hans Åberg via Std-
> Proposals wrote:
>> If issuing a warning instead of an error, it will compile if the definition
>> is in some other translation unit, though with a diagnostic message, which
>> then can be suppressed by adding a declaration or a compiler option.
>
> Warnings are errors in developer build modes. Therefore, if the standard
> advises a diagnostic for use of [[unimplemented]], it effectively means build
> failure.

If one does not like that, one should change the build system. It is popular, for example in Clang, to issue warnings for legitimate language features, and then some turn warnings into errors, but personally, I add pragmas inhibiting the Clang warnings.

> So how is it different from =delete("unimplemented")?

If you decide to not follow the specification, and change it in this way, then there is no difference. But it is not what is discussed here.

> How would you add a declaration to un-do an unimplemented? Please show what
> the preprocessed output would look like.

Just add a declaration of the same function without it. These should be language features, not preprocessed.

Received on 2025-03-20 09:54:50