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

Ville Voutilainen ville.voutilainen at gmail.com
Wed Feb 26 18:00:07 CET 2020


On Wed, 26 Feb 2020 at 18:45, Benjamin TERRIER <b.terrier at gmail.com> wrote:
> I would like the idea of using attributes for this. However, compilers are allowed to warn for unknown attributes, which is useful to detect typos.
> This means that we would get a warning for each usage of [[qt::emit]]. So unless there is a way to disable unknown attribute warnings for a specific set of custom attributes this will be a pain.

That's debatable. [dcl.attr]/6 says

Any attribute-token that is not recognized by the implementation is ignored.

In general, implementations can still warn about pretty much whatever
they please, especially considering
that their default modes are not strictly conforming.

The compilers we plan to support in Qt 6 do warn about unknown
attributes, so the allowance point is kinda
theoretical.


More information about the Development mailing list