[libc-commits] [libc] [libc][NFC] Add missing constexpr (PR #82007)

Guillaume Chatelet via libc-commits libc-commits at lists.llvm.org
Fri Feb 16 08:24:04 PST 2024


https://github.com/gchatelet created https://github.com/llvm/llvm-project/pull/82007

This is a fix forward for the Fuchsia build bot
https://lab.llvm.org/buildbot/#/builders/98/builds/33515


>From f6c48dd7e93a4252fe4ddca9631d81da43089afb Mon Sep 17 00:00:00 2001
From: Guillaume Chatelet <gchatelet at google.com>
Date: Fri, 16 Feb 2024 16:23:40 +0000
Subject: [PATCH] [libc][NFC] Add missing constexpr

This is a fix forward for the Fuchsia build bot
https://lab.llvm.org/buildbot/#/builders/98/builds/33515
---
 libc/src/__support/number_pair.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libc/src/__support/number_pair.h b/libc/src/__support/number_pair.h
index 934f41806b5f30..ee6667b1299fe8 100644
--- a/libc/src/__support/number_pair.h
+++ b/libc/src/__support/number_pair.h
@@ -21,8 +21,8 @@ template <typename T> struct NumberPair {
 };
 
 template <typename T>
-cpp::enable_if_t<cpp::is_integral_v<T> && cpp::is_unsigned_v<T>, NumberPair<T>>
-split(T a) {
+cpp::enable_if_t<cpp::is_integral_v<T> && cpp::is_unsigned_v<T>,
+                 NumberPair<T>> constexpr split(T a) {
   constexpr size_t HALF_BIT_WIDTH = sizeof(T) * 4;
   constexpr T LOWER_HALF_MASK = (T(1) << HALF_BIT_WIDTH) - T(1);
   NumberPair<T> result;



More information about the libc-commits mailing list