Should “cannot” be the preferred spelling? I see all three forms used in DiagnosticSemaKinds.td.
Discourse found a patch from 2014 that replaced “can not” with “cannot”, should we follow that?
Should “cannot” be the preferred spelling? I see all three forms used in DiagnosticSemaKinds.td.
Discourse found a patch from 2014 that replaced “can not” with “cannot”, should we follow that?
Thank you for bringing this up!
I think we should avoid contractions in general because the single quote in the contraction can be visually distracting due to us using single quotes around syntactic constructs in diagnostic messages.
So I prefer cannot
over can't
. can not
is grammatically incorrect, and while we don’t need diagnostics to be grammatically correct, this one is more like “typo” kind of incorrect and so I think it should change to cannot
as well.
It would be nice if clang had something like coding guidelines that would document various preferences and policies.
Edit: at least I couldn’t find any in the docs directory.
https://clang.llvm.org/docs/InternalsManual.html#diagnostic-wording
I can update that to mention avoiding contractions.
I’ll create a PR with the changes.
The PR to update the documentation is at: Clarify use of contractions in diagnostic messages by AaronBallman · Pull Request #116803 · llvm/llvm-project · GitHub