Open Bug 1786510 Opened 2 years ago Updated 2 years ago

C++ style guide: `// static` comment for implementations for static methods?

Categories

(Core :: General, task)

task

Tracking

()

People

(Reporter: saschanaz, Unassigned)

References

Details

There are several cases of this:

But not all static method implementations have this. Should this be in the style guide, or does it already require one?

Summary: `// static` comment for implementations for static methods? → C++ style guide: `// static` comment for implementations for static methods?

Hi bholley, is this something you have an answer for? Thanks!

Flags: needinfo?(bholley)

My vague memory is that initially /* static */ was required by the formatter despite people preferring // static, but some work was done to make the latter work, too. Unfortunately I can't find any related discussion on dev-platform so I might be mistaken.

I managed to find bug 1523969, which seems to be what I remembered. The first comment links to the dev-platform discussion.

See Also: → 1523969

Thanks! My specific point here is more about whether having that comment at all or not, though.

Oh, sorry, I misunderstood.

Is this something that clang-format is capable of generating? What percentage of our static methods are currently annotated?

Flags: needinfo?(bholley)

I'm not sure about clang-format, and given that nothing forces the existence of the comment I believe some significant amount but I have no data. (I can't imagine how to get that data without implementing a linter.)

I think the comments are sometimes useful, and so I don't really want to forbid them. But I also don't think this is important enough to invest non-trivial resources into linting for if the tools don't exist already. If that's the case, my guidance is to leave this unspecified.

You need to log in before you can comment on or make changes to this bug.