Fix use-out-of-constexpr lifetime detected by prerelease MSVC (#1312)

This was originally reported by @Zhaojun-Liu of Beyondsoft . This fix was suggested by @joemmett of the compiler frontend team.
This commit is contained in:
Billy O'Neal 2023-12-23 03:58:31 -05:00 коммит произвёл GitHub
Родитель 699be89b11
Коммит 5b8f9c40dd
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -1484,9 +1484,9 @@ namespace vcpkg
void append_log(const Path& path, const std::string& log, size_t max_log_length, std::string& out)
{
StringLiteral details_start = "<details><summary>{}</summary>\n\n```\n";
StringLiteral skipped_msg = "\n...\nSkipped {} lines\n...";
StringLiteral details_end = "\n```\n</details>\n\n";
static constexpr StringLiteral details_start = "<details><summary>{}</summary>\n\n```\n";
static constexpr StringLiteral skipped_msg = "\n...\nSkipped {} lines\n...";
static constexpr StringLiteral details_end = "\n```\n</details>\n\n";
const size_t context_size = path.native().size() + details_start.size() + details_end.size() +
skipped_msg.size() + 6 /* digits for skipped count */;
const size_t minimum_log_size = std::min(size_t{100}, log.size());