forked from OSchip/llvm-project
Fix dereference of pointers in throw statements.
Before: throw * x; After: throw *x; Patch by Erik Uhlmann. llvm-svn: 308185
This commit is contained in:
parent
8d0ecbedbe
commit
06b575ca81
|
@ -1383,7 +1383,8 @@ private:
|
|||
|
||||
if (PrevToken->isOneOf(tok::l_paren, tok::l_square, tok::l_brace,
|
||||
tok::comma, tok::semi, tok::kw_return, tok::colon,
|
||||
tok::equal, tok::kw_delete, tok::kw_sizeof) ||
|
||||
tok::equal, tok::kw_delete, tok::kw_sizeof,
|
||||
tok::kw_throw) ||
|
||||
PrevToken->isOneOf(TT_BinaryOperator, TT_ConditionalExpr,
|
||||
TT_UnaryOperator, TT_CastRParen))
|
||||
return TT_UnaryOperator;
|
||||
|
|
|
@ -5350,6 +5350,7 @@ TEST_F(FormatTest, UnderstandsUsesOfStarAndAmp) {
|
|||
verifyFormat("x = *a(x) = *a(y);", Left);
|
||||
verifyFormat("for (;; *a = b) {\n}", Left);
|
||||
verifyFormat("return *this += 1;", Left);
|
||||
verifyFormat("throw *x;", Left);
|
||||
|
||||
verifyIndependentOfContext("a = *(x + y);");
|
||||
verifyIndependentOfContext("a = &(x + y);");
|
||||
|
|
Loading…
Reference in New Issue