[Development] A modest proposal: disable lower-case keywords (emit, foreach, forever, signals, slots) by default

Thiago Macieira thiago.macieira at intel.com
Thu Feb 27 20:34:40 CET 2020


On Thursday, 27 February 2020 04:40:34 PST Ville Voutilainen wrote:
> The chance is very good; I talked about this with the maintainer of
> GCC already, and he was amenable to disabling
> an "unknown attribute" warning if the attribute has a namespace. For
> attributes that don't have namespaces,
> diagnosing unknown attributes allows diagnosing typos, so it's
> unlikely that all such warnings would be axed.

I think what we need is an attribute-declaring attribute. That way, the 
compiler can still warn about unknown attributes in case they are typos, but 
won't for attributes that the user intended to write.

[[declare_attribute(qt::emit)]];
later:

    [[qt::emit]] closed();

This is a standard change. Alternatively, [[gnu::declare_attribute(qt::emit)]] 
until C++23.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel System Software Products





More information about the Development mailing list