forked from OSchip/llvm-project
parent
498cce575f
commit
5f594f80f4
|
@ -701,8 +701,11 @@ private:
|
|||
for (FormatToken *Previous = Current.Previous;
|
||||
Previous && !Previous->isOneOf(tok::comma, tok::semi);
|
||||
Previous = Previous->Previous) {
|
||||
if (Previous->isOneOf(tok::r_square, tok::r_paren))
|
||||
if (Previous->isOneOf(tok::r_square, tok::r_paren)) {
|
||||
Previous = Previous->MatchingParen;
|
||||
if (!Previous)
|
||||
break;
|
||||
}
|
||||
if ((Previous->Type == TT_BinaryOperator ||
|
||||
Previous->Type == TT_UnaryOperator) &&
|
||||
Previous->isOneOf(tok::star, tok::amp)) {
|
||||
|
|
|
@ -9200,5 +9200,9 @@ TEST_F(FormatTest, DisableRegions) {
|
|||
" int k;"));
|
||||
}
|
||||
|
||||
TEST_F(FormatTest, DoNotCrashOnInvalidInput) {
|
||||
format("? ) =");
|
||||
}
|
||||
|
||||
} // end namespace tooling
|
||||
} // end namespace clang
|
||||
|
|
Loading…
Reference in New Issue