Specifically, typo correction should be done before dispatching between
different kinds of binary operations like pseudo-object assignment,
overloaded binary operation, etc.
Without this change we hit an assertion
Assertion failed: (!LHSExpr->hasPlaceholderType(BuiltinType::PseudoObject)), function CheckAssignmentOperands
when in Objective-C we reference a property without self and there are
2 equally good typo correction candidates: ivar and a class name. In
this case LHS expression in BuildBinOp is
CXXDependentScopeMemberExpr `-TypoExpr
and instead of handling Obj-C property assignment as pseudo-object
assignment, we call CreateBuiltinBinOp which corrects typo to
ObjCPropertyRefExpr '<pseudo-object type>' `-ImplicitCastExpr `-ObjCIvarRefExpr `-ImplicitCastExpr `-DeclRefExpr
but cannot handle pseudo-objects and asserts about it (indirectly,
through CheckAssignmentOperands).
There is no crash in Objective-C++ but I've added a test case because in
the fix we execute different paths for C and C++. I've also considered
removing typo correction from CreateBuiltinBinOp and it doesn't cause
any test failures. But I decided to keep it because CreateBuiltinBinOp
sometimes is called directly, not through BuildBinOp.
rdar://problem/33102722