[cfe-dev] isInfixBinaryOp weird behavior

Dorian Haglund via cfe-dev cfe-dev at lists.llvm.org
Thu Jul 12 07:59:13 PDT 2018


Hey,

CXXOperatorCallExpr::isInfixBinaryOp() returns true for overloaded postfix
increment/decrement.
It returns false for the prefix increment/decrement.

I know this behavior is consistent with the commentary.
(i'm guessing that the behavior comes from he fact that the postfix
increment is overloaded using an extra unused parameter)

I think isInfixBinaryOp should never return true for increment and
decrement operator, regardless of where they are.

As it is, this function caused a interesting bug on my side :)

Best regards,

-- 
Dorian Haglund
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180712/2cf6027b/attachment.html>


More information about the cfe-dev mailing list