klimek added inline comments.
================ Comment at: clang/include/clang/Format/Format.h:50 struct FormatStyle { + /// Indents after access modifiers. i.e. + /// \code ---------------- I think we need to explain this a bit more: What this does is: Indent classes with access modifiers at 2x indent compared to classes without access modifiers, while keeping the access modifiers at a normal indent. ================ Comment at: clang/lib/Format/UnwrappedLineParser.cpp:2009 + // classes case + if (Style.AccessModifierIndentation && Line->Level % 2 == 0) + --Line->Level; ---------------- What if the class starts at level 1? (for example, inside a function or due to namespace indentation) namespace A { class B { public: .. }; } ================ Comment at: clang/lib/Format/UnwrappedLineParser.cpp:2022 + // After we wrap for Access modifier then indent a level if desired + if (Style.AccessModifierIndentation && Line->Level >= 1) + ++Line->Level; ---------------- Similarly, I think we need to remember whether we unindented, as otherwise I think we can run into cases where this is true, but the previous was false (class declared at level > 1). ================ Comment at: clang/lib/Format/UnwrappedLineParser.cpp:2230 + Next = Tokens->getNextToken(); + if (!Next) + break; ---------------- We should structure this like other parse loops in this file, using switch and eof (instead of !Next). See parseParens() for a good example. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60225/new/ https://reviews.llvm.org/D60225 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits