aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-03-30 11:56:00 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-03-30 11:56:00 +0000
commit66dca6eaaa2e9c24023fc919ab72b8ae2df1e288 (patch)
tree19d28f47ad47710b3b64e02dd71f54dedb93c493 /lib/Sema
parent76f7761daee0fafd7609b25c95af4e011c743873 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178412 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r--lib/Sema/SemaExpr.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 62bfa3c709..75da99c344 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/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);