[PATCH] D25213: Fix PR28181: Prevent operator overloading related assertion failure crash that happens in C only

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 3 15:30:04 PDT 2016


rsmith added inline comments.


> SemaOverload.cpp:11750
>  ExprResult
>  Sema::CreateOverloadedBinOp(SourceLocation OpLoc,
>                              BinaryOperatorKind Opc,

We should never be calling this function outside of C++ mode.

It looks like the bug is in `Sema::BuildBinOp` -- in C, it should call `CorrectDelayedTyposInExpr` before doing almost anything else. The relevant code is currently in `CreateBuiltinBinOp`, which is too late. Moving that code to the start of `BuildBinOp` should solve the problem.

Repository:
  rL LLVM

https://reviews.llvm.org/D25213





More information about the cfe-commits mailing list