================
@@ -14883,14 +14880,12 @@ void Sema::CheckArrayAccess(const Expr *BaseExpr,
const Expr *IndexExpr,
// Diag message shows element size in bits and in "bytes" (platform-
// dependent CharUnits)
- DiagRuntimeBehavior(BaseExpr->getBeginLoc(), BaseExpr,
- PDiag(DiagID)
- << toString(index, 10, true) << AddrBits
- << (unsigned)ASTC.toBits(*ElemCharUnits)
- << toString(ElemBytes, 10, false)
- << toString(MaxElems, 10, false)
- << (unsigned)MaxElems.getLimitedValue(~0U)
- << IndexExpr->getSourceRange());
+ DiagRuntimeBehavior(
+ BaseExpr->getBeginLoc(), BaseExpr,
+ PDiag(DiagID) << index << AddrBits
+ << (unsigned)ASTC.toBits(*ElemCharUnits) << ElemBytes
+ << MaxElems << (unsigned)MaxElems.getLimitedValue(~0U)
----------------
snarang181 wrote:
The %5 is being used as a pluralization helper `"element%s5"` so it is not
really deadweight. I used `getZExtValue()` to not have to truncate the value.
https://github.com/llvm/llvm-project/pull/161474
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits