https://llvm.org/bugs/show_bug.cgi?id=30849

            Bug ID: 30849
           Summary: clang-format doesn't recognize access modifiers
                    expanded by preprocessor?
           Product: clang
           Version: 3.8
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangb...@nondot.org
          Reporter: d...@kegel.com
                CC: djas...@google.com, kli...@google.com,
                    llvm-bugs@lists.llvm.org
    Classification: Unclassified

Input:

#define _PRIVATE private
class x {
public:
  int y;

_PRIVATE:
  int z;
};


Bad output:

#define _PRIVATE private
class x {
public:
  int y;

  _PRIVATE : int z;
};

Desired output to treat a 'private' expanded from a macro the same as a bare
'private', i.e.

#define _PRIVATE private
class x {
public:
  int y;

_PRIVATE:
  int z;
};

The use case is "developers who need to be able to build a codebase with
private changed to public sometimes, and use a preprocessor definition to do
the dirty deed".

The codebase in question is 322KLOC, and this is the only showstopper for
using clang-format as the automated formatter for every commit.

Tested with 
clang-format version 3.8.0-2ubuntu4 (the default clang-format on ubuntu 16.04)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to