From aaee1d2723ed40721b2e728193a698f1d901a511 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 10 Feb 2022 10:06:17 +0100 Subject: [PATCH] [rust] Remove constexpr from functions that call non-constexpr functions The CHECK macros will call non-constexpr functions on failure. While this is legal C++14 as long as the function doesn't actually get called, GCC 5.4 will choke on it. --- compiler-rt/lib/sanitizer_common/sanitizer_common.h | 2 +- compiler-rt/lib/sanitizer_common/sanitizer_stack_store.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common.h b/compiler-rt/lib/sanitizer_common/sanitizer_common.h index 08c6062ba067..fc5aeccf2d0b 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_common.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_common.h @@ -443,7 +443,7 @@ inline uptr RoundUpToPowerOfTwo(uptr size) { return 1ULL << (up + 1); } -inline constexpr uptr RoundUpTo(uptr size, uptr boundary) { +inline uptr RoundUpTo(uptr size, uptr boundary) { RAW_CHECK(IsPowerOfTwo(boundary)); return (size + boundary - 1) & ~(boundary - 1); } diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_stack_store.h b/compiler-rt/lib/sanitizer_common/sanitizer_stack_store.h index 4f1a8caac6ed..ddb96d2cce1c 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_stack_store.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_stack_store.h @@ -61,7 +61,7 @@ class StackStore { return frame_idx % kBlockSizeFrames; } - static constexpr uptr IdToOffset(Id id) { + static uptr IdToOffset(Id id) { CHECK_NE(id, 0); return id - 1; // Avoid zero as id. }