C++ Logo

std-proposals

Advanced search

[std-proposals] unimplemented attribute

From: Samuel Alonso Rodríguez <samuelalonso26_at_[hidden]>
Date: Tue, 18 Mar 2025 09:47:15 +0000
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?

Received on 2025-03-18 09:47:34