C++ Logo

std-proposals

Advanced search

Re: [std-proposals] unimplemented attribute

From: Bo Persson <bo_at_[hidden]>
Date: Tue, 18 Mar 2025 11:06:59 +0100
On 2025-03-18 at 10:47, Samuel Alonso Rodríguez via Std-Proposals wrote:
> This attribute is meant to be used in function (member or free, static
> or non-static, template or non-template) declarations to indicate that
> the function declaration is left unimplemented (without a definition)
> with an additional diagnostic message that can be fixed or opt-in thru
> an unevaluated string literal.
>
> The interesting bit comes from its behaviour: defining any function
> marked with such attribute, lleads to an ill-formed program (preferably
> with a diagnostic message), making calls to it be always diagnosable in
> non-linking time, because no TU can ever define this.
>
> The only catch so far is: redeclarations w/o this attribute would break
> that assumption. I thought of straight banning redeclarations but I
> think that’s too much. Maybe forcing redeclarations to have this
> attribute aswell, once the former declaration has it, could be an
> interesting idea to explore.
>
> What do you all think?
>

How is this different from a deleted function?

https://en.cppreference.com/w/cpp/language/function#Deleted_functions

Received on 2025-03-18 10:07:08