forked from OSchip/llvm-project
clang-format: Don't indent 'signals' as access specifier if it isn't one
Before: { signals.set(0); } After: { signals.set(0); } llvm-svn: 236630
This commit is contained in:
parent
653c1099b4
commit
036181471c
|
@ -105,7 +105,9 @@ private:
|
|||
Style.Language == FormatStyle::LK_JavaScript)
|
||||
return 0;
|
||||
if (RootToken.isAccessSpecifier(false) ||
|
||||
RootToken.isObjCAccessSpecifier() || RootToken.is(Keywords.kw_signals))
|
||||
RootToken.isObjCAccessSpecifier() ||
|
||||
(RootToken.is(Keywords.kw_signals) && RootToken.Next &&
|
||||
RootToken.Next->is(tok::colon)))
|
||||
return Style.AccessModifierOffset;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1939,6 +1939,9 @@ TEST_F(FormatTest, UnderstandsAccessSpecifiers) {
|
|||
// Don't interpret 'signals' the wrong way.
|
||||
verifyFormat("signals.set();");
|
||||
verifyFormat("for (Signals signals : f()) {\n}");
|
||||
verifyFormat("{\n"
|
||||
" signals.set(); // This needs indentation.\n"
|
||||
"}");
|
||||
}
|
||||
|
||||
TEST_F(FormatTest, SeparatesLogicalBlocks) {
|
||||
|
|
Loading…
Reference in New Issue