C++ Logo

std-proposals

Advanced search

Re: [std-proposals] unimplemented attribute

From: (wrong string) Åberg <haberg_1_at_[hidden]>
Date: Wed, 19 Mar 2025 17:48:29 +0100
> On 19 Mar 2025, at 16:48, Andre Kostur via Std-Proposals <std-proposals_at_[hidden]> wrote:
>
> Not that I agree with the proposal, but the scenario I'm hearing:
> 1) A cpp file includes a header with an [[unimplemented]] function
> (say the modf example above)
> 2) That cpp file then includes a header with the same function, but
> this time without the [[unimplemented]] attribute
> 3) The cpp file then calls that function.
>
> If one was to use =delete instead, #2 would be a compiler error as
> that would be redeclaring the same function. And if #2 doesn't exist,
> then the compilation could emit a diagnostic (before it got to the
> link stage). Though I'm not yet sold that simply not declaring the
> function at all isn't the better option anyway.

This is just so as to not having to rely solely on linker errors and tables over what is so far implemented in the C++ version. 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.

Received on 2025-03-19 16:48:46