forked from OSchip/llvm-project
clang-format: More selectively detect QT's "signals".
llvm-svn: 235702
This commit is contained in:
parent
8dee8575c6
commit
de0d1f3c26
|
@ -754,7 +754,11 @@ void UnwrappedLineParser::parseStructuralElement() {
|
|||
return;
|
||||
}
|
||||
if (FormatTok->is(Keywords.kw_signals)) {
|
||||
parseAccessSpecifier();
|
||||
nextToken();
|
||||
if (FormatTok->is(tok::colon)) {
|
||||
nextToken();
|
||||
addUnwrappedLine();
|
||||
}
|
||||
return;
|
||||
}
|
||||
// In all other cases, parse the declaration.
|
||||
|
|
|
@ -1900,6 +1900,10 @@ TEST_F(FormatTest, UnderstandsAccessSpecifiers) {
|
|||
"signals:\n"
|
||||
" void g();\n"
|
||||
"};");
|
||||
|
||||
// Don't interpret 'signals' the wrong way.
|
||||
verifyFormat("signals.set();");
|
||||
verifyFormat("for (Signals signals : f()) {\n}");
|
||||
}
|
||||
|
||||
TEST_F(FormatTest, SeparatesLogicalBlocks) {
|
||||
|
|
Loading…
Reference in New Issue