Interesting set of implementation properties.

What is the goal? Why would we want this? (I can guess some answers, but this is missing from your proposal)

How does this interact with overloading? What happens if you take the address of such a function and never call it, what happens if you instantiate a template with the address of it?

Regards,
Peter

On Tue, Mar 18, 2025 at 10:47 AM Samuel Alonso Rodríguez via Std-Proposals <std-proposals@lists.isocpp.org> 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?
--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals