Commit d3e8c837 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

cppgc: Fix compile-time typename for release builds

Bug: chromium:1056170
Change-Id: I3320a0b8c740067ea1e424c37ae8db4e87753c1a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2461738
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: 's avatarAnton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70419}
parent 69388737
......@@ -16,13 +16,16 @@ namespace internal {
#if CPPGC_SUPPORTS_OBJECT_NAMES && defined(__clang__)
#define CPPGC_SUPPORTS_COMPILE_TIME_TYPENAME 1
// Provides constexpr c-string storage for a name of fixed |Size| characters.
// Automatically appends terminating 0 byte.
template <size_t Size>
struct NameBuffer {
char name[Size]{};
char name[Size + 1]{};
static constexpr NameBuffer FromCString(const char* str) {
NameBuffer result;
for (size_t i = 0; i < Size; ++i) result.name[i] = str[i];
result.name[Size] = 0;
return result;
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment