From 1cb8106d87a2b5acdcd1a1e673ac7dbe3ea13dbb Mon Sep 17 00:00:00 2001 From: Chester Liu Date: Sat, 10 Oct 2020 17:48:12 +0800 Subject: [PATCH] Suppress 26445 inside til::at --- src/inc/til/at.h | 1 + src/terminal/parser/OutputStateMachineEngine.cpp | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/inc/til/at.h b/src/inc/til/at.h index f08f7bb08bb5..592129634aee 100644 --- a/src/inc/til/at.h +++ b/src/inc/til/at.h @@ -39,6 +39,7 @@ namespace til { #pragma warning(suppress : 26482) // Suppress bounds.2 check for indexing with constant expressions #pragma warning(suppress : 26446) // Suppress bounds.4 check for subscript operator. +#pragma warning(suppress : 26445) // Suppress lifetime check for a reference to gsl::span or std::string_view return cont[i]; } diff --git a/src/terminal/parser/OutputStateMachineEngine.cpp b/src/terminal/parser/OutputStateMachineEngine.cpp index 4454f286ff2e..8c8984cd9aab 100644 --- a/src/terminal/parser/OutputStateMachineEngine.cpp +++ b/src/terminal/parser/OutputStateMachineEngine.cpp @@ -1391,8 +1391,8 @@ try for (size_t i = 0, j = 1; j < parts.size(); i += 2, j += 2) { unsigned int tableIndex = 0; - const bool indexSuccess = Utils::StringToUint(parts.at(i), tableIndex); - const auto colorOptional = Utils::ColorFromXTermColor(parts.at(j)); + const bool indexSuccess = Utils::StringToUint(til::at(parts, i), tableIndex); + const auto colorOptional = Utils::ColorFromXTermColor(til::at(parts, j)); if (indexSuccess && colorOptional.has_value()) { newTableIndexes.push_back(tableIndex); @@ -1475,7 +1475,7 @@ try std::vector newRgbs; for (size_t i = 0; i < parts.size(); i++) { - const auto colorOptional = Utils::ColorFromXTermColor(parts.at(i)); + const auto colorOptional = Utils::ColorFromXTermColor(til::at(parts, i)); if (colorOptional.has_value()) { newRgbs.push_back(colorOptional.value());