Alejandro =?utf-8?q?=C3=81lvarez_Ayll=C3=B3n?=, Alejandro =?utf-8?q?=C3=81lvarez_Ayll=C3=B3n?=, Alejandro =?utf-8?q?=C3=81lvarez_Ayll=C3=B3n?= Message-ID: In-Reply-To: <llvm.org/llvm/llvm-project/pull/159...@github.com>
================ @@ -637,11 +636,11 @@ static Messages getNegativeIndexMessage(StringRef Name, Name, ArraySizeVal, IndexStr)}; } -static std::string truncateWithEllipsis(StringRef str, size_t maxLength) { - if (str.size() <= maxLength) - return str.str(); +static std::string truncateWithEllipsis(StringRef Str, size_t MaxLength) { + if (Str.size() <= MaxLength) + return Str.str(); - return (str.substr(0, maxLength - 3) + "...").str(); + return (Str.substr(0, MaxLength - 3) + "...").str(); } ---------------- steakhal wrote: Can we make `MaxLength` of `int` and a non type template parameter? That way static asserts could enforce the preconditions. https://github.com/llvm/llvm-project/pull/159357 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits