]> granicus.if.org Git - clang/commit
clang-format: Don't allow labels when expecting declarations.
authorDaniel Jasper <djasper@google.com>
Tue, 7 Apr 2015 14:36:33 +0000 (14:36 +0000)
committerDaniel Jasper <djasper@google.com>
Tue, 7 Apr 2015 14:36:33 +0000 (14:36 +0000)
commitbcea7de374d27e5560671e2f99b390c793878a75
treefc7ec1ebc89211167f84e5da3ad2c0b71dc462e5
parenta388c2a9b11b803fe804d4e2bb81d3eb5ba46a8c
clang-format: Don't allow labels when expecting declarations.

This fixes formatting unnamed bitfields (llvm.org/PR21999).

Before:
  struct MyStruct {
    uchar data;
  uchar:
    8;
  uchar:
    8;
    uchar other;
  };

After:
  struct MyStruct {
    uchar data;
    uchar : 8;
    uchar : 8;
    uchar other;
  };

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234318 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/UnwrappedLineParser.cpp
unittests/Format/FormatTest.cpp