This came up in a code review, but I had nothing to point to.
It seems reasonably common practice.
Happy to put the words somewhere else, if that seems preferable.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Sounds good to me - I'd usually put spaces inside the start/end of the comment (& maybe between the comment & the constant) but that's just me - I'm not fussed about which way it's documented (although - best it's documented whatever way clang-format formats it, so as not to be confusing)
+1 for writing it as you have it, it's what clang-format does, and so far as I know it's the prevailing style.
LGTM for the actual style change, just a wording nit:
llvm/docs/CodingStandards.rst | ||
---|---|---|
308 ↗ | (On Diff #173754) | Minor nit: s/To document/When documenting/ to maintain consistency with the previous bullet points |
My experiments with clang-format show that it is aware of this convention. It will change /*Prefix*/nullptr to /*Prefix*/ nullptr (inserting a space) and will also change /*Prefix=*/ nullptr to /*Prefix=*/nullptr (removing the space, if the comment ends with =).