forked from OSchip/llvm-project
clang-format: Inside decltype(), there is an expression.
Before: decltype(a* b) F(); After: decltype(a * b) F(); llvm-svn: 244891
This commit is contained in:
parent
5eaa009e57
commit
033181bcd2
|
@ -120,8 +120,9 @@ private:
|
|||
}
|
||||
|
||||
if (Left->Previous &&
|
||||
(Left->Previous->isOneOf(tok::kw_static_assert, tok::kw_if,
|
||||
tok::kw_while, tok::l_paren, tok::comma) ||
|
||||
(Left->Previous->isOneOf(tok::kw_static_assert, tok::kw_decltype,
|
||||
tok::kw_if, tok::kw_while, tok::l_paren,
|
||||
tok::comma) ||
|
||||
Left->Previous->is(TT_BinaryOperator))) {
|
||||
// static_assert, if and while usually contain expressions.
|
||||
Contexts.back().IsExpression = true;
|
||||
|
|
|
@ -5408,6 +5408,7 @@ TEST_F(FormatTest, UnderstandsUsesOfStarAndAmp) {
|
|||
verifyFormat("auto PointerBinding = [](const char *S) {};");
|
||||
verifyFormat("typedef typeof(int(int, int)) *MyFunc;");
|
||||
verifyFormat("[](const decltype(*a) &value) {}");
|
||||
verifyFormat("decltype(a * b) F();");
|
||||
verifyFormat("#define MACRO() [](A *a) { return 1; }");
|
||||
verifyIndependentOfContext("typedef void (*f)(int *a);");
|
||||
verifyIndependentOfContext("int i{a * b};");
|
||||
|
|
Loading…
Reference in New Issue