[PATCH] D60225: [clang-format] [PR19056] Add support for indenting class members and methods one level under the modifiers

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 3 12:24:30 PDT 2019


MyDeveloperDay created this revision.
MyDeveloperDay added reviewers: klimek, djasper, JonasToth, russellmcc, reuk.
MyDeveloperDay added a project: clang-tools-extra.

Code::Blocks and Qt Creator code uses a style guide which recommends indenting the next line after the access modifier e.g.

  class Foo
  {
        int abc;
  
        public:
            int def;
            void foo();
  
        private:
            int ghi;
            void foo();
  }

The following patch with the addition of a new option

  AccessModifierIndentation: true

This PR was raised a long time ago (2014), and recently was pinged for an update

The following patch aim to address this issue, potentially allowing clang-format to be used (rather than astyle)


https://reviews.llvm.org/D60225

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/include/clang/Format/Format.h
  clang/lib/Format/Format.cpp
  clang/lib/Format/UnwrappedLineParser.cpp
  clang/lib/Format/UnwrappedLineParser.h
  clang/unittests/Format/FormatTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60225.193567.patch
Type: text/x-patch
Size: 15866 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190403/4b299a45/attachment-0001.bin>


More information about the cfe-commits mailing list