Skip to content

Commit

Permalink
Fix use-out-of-constexpr lifetime detected by prerelease MSVC (#1312)
Browse files Browse the repository at this point in the history
This was originally reported by @Zhaojun-Liu of Beyondsoft . This fix was suggested by @joemmett of the compiler frontend team.
  • Loading branch information
BillyONeal authored Dec 23, 2023
1 parent 699be89 commit 5b8f9c4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/vcpkg/commands.build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 5b8f9c4

Please sign in to comment.