[clang] [clang][SSAF][NFC] Reorder class sections to `public`-`protected`-`private` per LLVM coding standards (PR #193061)
Balázs Benics via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 21 02:36:32 PDT 2026
https://github.com/steakhal commented:
I'll just say that it was a huge pain point for me. I had a dislike of looking at these classes because of this unstructured nature.
I've heard in the past that well, clang classes were already a mess. Even if that is true, I never understood why we shouldn't strive for something better.
---
I'd propose an additional partial ordering rule.
How about putting the data members to the end of the sections. Namely, private data members should come last. But of course I'm somewhat pragmatic on this end.
I also find it useful to have the ctor or factory producing something at the top of the class - or close there so that when I click "goto definition" of the type, I'll already know how to construct one of that. This is of course pretty subjective, and I could live without.
https://github.com/llvm/llvm-project/pull/193061
More information about the cfe-commits
mailing list