diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2013-03-30 11:56:00 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2013-03-30 11:56:00 +0000 |
| commit | 0345f9f900ec606adc012c4c3d0cb86b04dffe20 (patch) | |
| tree | eeb22a7d68bd8f90b0fa9b05e93f4a541bd3ddd5 /clang/lib/Sema | |
| parent | 6447c475411adf29250a8ce903ffc3335da40d0b (diff) | |
| download | bcm5719-llvm-0345f9f900ec606adc012c4c3d0cb86b04dffe20.tar.gz bcm5719-llvm-0345f9f900ec606adc012c4c3d0cb86b04dffe20.zip | |
Sema: Don't crash when trying to emit a precedence warning on postinc/decrement.
Post-Inc can occur as a binary call (the infamous dummy int argument), but it's
not really a binary operator.
Fixes PR15628.
llvm-svn: 178412
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 62bfa3c709d..75da99c344c 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -5412,7 +5412,8 @@ static bool IsArithmeticBinaryExpr(Expr *E, BinaryOperatorKind *Opcode, // Make sure this is really a binary operator that is safe to pass into // BinaryOperator::getOverloadedOpcode(), e.g. it's not a subscript op. OverloadedOperatorKind OO = Call->getOperator(); - if (OO < OO_Plus || OO > OO_Arrow) + if (OO < OO_Plus || OO > OO_Arrow || + OO == OO_PlusPlus || OO == OO_MinusMinus) return false; BinaryOperatorKind OpKind = BinaryOperator::getOverloadedOpcode(OO); |

