Commit f4e02f26 authored by Leszek Swirski's avatar Leszek Swirski Committed by V8 LUCI CQ

[turbofan] Remove defn of constexpr vars for C++17

It's deprecated in C++17 and not needed (it was needed for static const,
but not for constexpr). It's needed in C++14, but can trigger
deprecation errors in C++17, so include it conditionally on __cplusplus.

Bug: chromium:1274247
Change-Id: I92524f377bb92ac2aa008f15830920786a1c1432
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3308795
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78157}
parent 3ca76de1
......@@ -591,6 +591,13 @@ V8 shared library set USING_V8_SHARED.
#define V8_CAGED_POINTERS
#endif
// From C++17 onwards, static constexpr member variables are defined to be
// "inline", and adding a separate definition for them can trigger deprecation
// warnings. For C++14 and below, however, these definitions are required.
#if __cplusplus < 201703L
#define V8_STATIC_CONSTEXPR_VARIABLES_NEED_DEFINITIONS
#endif
// clang-format on
#undef V8_HAS_CPP_ATTRIBUTE
......
......@@ -30,10 +30,13 @@ namespace compiler {
#define TRACE(broker, x) TRACE_BROKER(broker, x)
#ifdef V8_STATIC_CONSTEXPR_VARIABLES_NEED_DEFINITIONS
// These definitions are here in order to please the linker, which in debug mode
// sometimes requires static constants to be defined in .cc files.
// This is, however, deprecated (and unnecessary) in C++17.
const uint32_t JSHeapBroker::kMinimalRefsBucketCount;
const uint32_t JSHeapBroker::kInitialRefsBucketCount;
#endif
void JSHeapBroker::IncrementTracingIndentation() { ++trace_indentation_; }
......
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