Skip to content

Commit

Permalink
[rust] Remove constexpr from functions that call non-constexpr functions
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nikic committed Feb 10, 2022
1 parent 8b2c25d commit 75fef2e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compiler-rt/lib/sanitizer_common/sanitizer_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,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);
}
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/sanitizer_common/sanitizer_stack_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}
Expand Down

0 comments on commit 75fef2e

Please sign in to comment.