C++ Logo

std-proposals

Advanced search

Re: [std-proposals] unimplemented attribute

From: Hans Åberg <haberg_1_at_[hidden]>
Date: Tue, 18 Mar 2025 20:44:30 +0100
> On 18 Mar 2025, at 20:23, Marcin Jaczewski <marcinjaczewski86_at_[hidden]> wrote:
>
> wt., 18 mar 2025 o 20:18 Hans Åberg <haberg_1_at_[hidden]> napisał(a):
>>
>>> On 18 Mar 2025, at 20:10, Marcin Jaczewski <marcinjaczewski86_at_[hidden]> wrote:
>>>
>>> Should this code compile or not? when exactly should it compiler and
>>> when it should not?
>>
>> If it is a warning, it compiles with a diagnostic. But if you think it is safe, an error may be required.
>
> But this means this will not link, what point for warning as the whole
> compilation fails?
> If we have definitions when this warning is pointless as linking will
> succeed and program will run.
> Or do I miss something here? Because what you say is behavior of `[[obsolete]]`.

If you only get a linker error, it may be tricker to find out what exactly is missing; a warning would tell that.

With an error, one must handle the case when the definition is in a source file and the unimplemented directive in a header file, which must be overridden somehow if used in another source file. With a warning one gets a correct compile.

Received on 2025-03-18 19:44:45