Index: lib/ubsan/ubsan_handlers.cc =================================================================== --- lib/ubsan/ubsan_handlers.cc +++ lib/ubsan/ubsan_handlers.cc @@ -103,9 +103,8 @@ } /// \brief Common diagnostic emission for various forms of integer overflow. -template static void handleIntegerOverflowImpl(OverflowData *Data, ValueHandle LHS, - const char *Operator, T RHS, + const char *Operator, const Value &RHSVal, ReportOptions Opts) { SourceLocation Loc = Data->Loc.acquire(); bool IsSigned = Data->Type.isSignedIntegerTy(); @@ -120,7 +119,7 @@ Diag(Loc, DL_Error, "%0 integer overflow: " "%1 %2 %3 cannot be represented in type %4") << (IsSigned ? "signed" : "unsigned") - << Value(Data->Type, LHS) << Operator << RHS << Data->Type; + << Value(Data->Type, LHS) << Operator << RHSVal << Data->Type; } #define UBSAN_OVERFLOW_HANDLER(handler_name, op, unrecoverable) \