[libc-commits] [libc] Reland "[libc][NFC] Propagate LIBC_CONSTEXPR qualifier for those depending on bit_cast." (PR #197479)

LLVM Continuous Integration via libc-commits libc-commits at lists.llvm.org
Wed May 13 08:48:23 PDT 2026


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `openmp-offload-libc-amdgpu-runtime` running on `omp-vega20-1` while building `libc` at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/73/builds/25199

<details>
<summary>Here is the relevant piece of the build log for the reference</summary>

```
Step 4 (annotate) failure: '../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py --cmake-file=AMDGPULibcBot.cmake' (failure)
...
[221/2719] Building CXX object libc/src/math/amdgpu/CMakeFiles/libc.src.math.amdgpu.ceilf.dir/ceilf.cpp.o
[222/2719] Building CXX object libc/src/stdlib/CMakeFiles/libc.src.stdlib.abort.dir/abort.cpp.o
[223/2719] Building CXX object libc/src/stdlib/CMakeFiles/libc.src.stdlib.at_quick_exit.dir/at_quick_exit.cpp.o
[224/2719] Building CXX object libc/src/stdio/gpu/CMakeFiles/libc.src.stdio.gpu.fclose.dir/fclose.cpp.o
[225/2719] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.isnan.dir/isnan.cpp.o
[226/2719] Building CXX object libc/src/stdio/gpu/CMakeFiles/libc.src.stdio.gpu.fread.dir/fread.cpp.o
[227/2719] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.isnanf.dir/isnanf.cpp.o
[228/2719] Building CXX object libc/src/stdio/gpu/CMakeFiles/libc.src.stdio.gpu.puts.dir/puts.cpp.o
[229/2719] Building CXX object libc/src/stdlib/CMakeFiles/libc.src.stdlib.atexit.dir/atexit.cpp.o
[230/2719] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmul.dir/fmul.cpp.o
FAILED: libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmul.dir/fmul.cpp.o 
/home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/build/./bin/clang++ --target=amdgcn-amd-amdhsa -DLIBC_NAMESPACE=__llvm_libc_23_0_0_git -D__LIBC_USE_FLOAT16_CONVERSION -I/home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc -isystem /home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/build/include/amdgcn-amd-amdhsa -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Xclang -fno-pch-timestamp -O3 -DNDEBUG --target=amdgcn-amd-amdhsa -D__LIBC_USE_BUILTIN_ISNAN -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_COPT_STRING_LENGTH_IMPL=element -DLIBC_COPT_FIND_FIRST_CHARACTER_IMPL=element -DLIBC_ADD_NULL_CHECKS "-DLIBC_MATH=(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_INTERMEDIATE_COMP_IN_FLOAT | LIBC_MATH_SMALL_TABLES | LIBC_MATH_NO_ERRNO | LIBC_MATH_NO_EXCEPT)" -fno-math-errno -DLIBC_ERRNO_MODE=LIBC_ERRNO_MODE_SHARED -DLIBC_THREAD_MODE=LIBC_THREAD_MODE_SINGLE -DLIBC_COPT_TIMEOUT_ENSURE_MONOTONICITY -DLIBC_CONF_WCTYPE_MODE=LIBC_WCTYPE_MODE_ASCII -DLIBC_COPT_RAW_MUTEX_DEFAULT_SPIN_COUNT=100 -DLIBC_TARGET_OS_IS_GPU -fpie -DLIBC_FULL_BUILD -nostdlibinc -ffixed-point -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wdeprecated -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -nogpulib -fvisibility=hidden -fconvergent-functions -flto -Wno-multi-gpu -Xclang -mcode-object-version=none -DLIBC_COPT_PUBLIC_PACKAGING -UNDEBUG -MD -MT libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmul.dir/fmul.cpp.o -MF libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmul.dir/fmul.cpp.o.d -o libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmul.dir/fmul.cpp.o -c /home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/math/generic/fmul.cpp
In file included from /home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/math/generic/fmul.cpp:10:
In file included from /home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/__support/math/fmul.h:15:
In file included from /home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/__support/FPUtil/generic/mul.h:16:
/home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:63:43: error: constexpr function never produces a constant expression [-Winvalid-constexpr]
   63 | template <> LIBC_INLINE constexpr float16 max(float16 x, float16 y) {
      |                                           ^~~
/home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:64:19: note: non-constexpr constructor 'FPBits<_Float16>' cannot be used in a constant expression
   64 |   FPBits<float16> x_bits(x);
      |                   ^
/home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/__support/FPUtil/FPBits.h:839:39: note: declared here
  839 |   LIBC_INLINE LIBC_CONSTEXPR explicit FPBits(XType x) {
      |                                       ^
In file included from /home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/math/generic/fmul.cpp:10:
In file included from /home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/__support/math/fmul.h:15:
In file included from /home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/__support/FPUtil/generic/mul.h:16:
/home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:116:43: error: constexpr function never produces a constant expression [-Winvalid-constexpr]
  116 | template <> LIBC_INLINE constexpr float16 min(float16 x, float16 y) {
      |                                           ^~~
/home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:117:19: note: non-constexpr constructor 'FPBits<_Float16>' cannot be used in a constant expression
  117 |   FPBits<float16> x_bits(x);
      |                   ^
/home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/__support/FPUtil/FPBits.h:839:39: note: declared here
  839 |   LIBC_INLINE LIBC_CONSTEXPR explicit FPBits(XType x) {
      |                                       ^
2 errors generated.
[231/2719] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalizef16.dir/canonicalizef16.cpp.o
FAILED: libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalizef16.dir/canonicalizef16.cpp.o 
/home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/build/./bin/clang++ --target=amdgcn-amd-amdhsa -DLIBC_NAMESPACE=__llvm_libc_23_0_0_git -D__LIBC_USE_FLOAT16_CONVERSION -I/home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc -isystem /home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/build/include/amdgcn-amd-amdhsa -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Xclang -fno-pch-timestamp -O3 -DNDEBUG --target=amdgcn-amd-amdhsa -D__LIBC_USE_BUILTIN_ISNAN -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_COPT_STRING_LENGTH_IMPL=element -DLIBC_COPT_FIND_FIRST_CHARACTER_IMPL=element -DLIBC_ADD_NULL_CHECKS "-DLIBC_MATH=(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_INTERMEDIATE_COMP_IN_FLOAT | LIBC_MATH_SMALL_TABLES | LIBC_MATH_NO_ERRNO | LIBC_MATH_NO_EXCEPT)" -fno-math-errno -DLIBC_ERRNO_MODE=LIBC_ERRNO_MODE_SHARED -DLIBC_THREAD_MODE=LIBC_THREAD_MODE_SINGLE -DLIBC_COPT_TIMEOUT_ENSURE_MONOTONICITY -DLIBC_CONF_WCTYPE_MODE=LIBC_WCTYPE_MODE_ASCII -DLIBC_COPT_RAW_MUTEX_DEFAULT_SPIN_COUNT=100 -DLIBC_TARGET_OS_IS_GPU -fpie -DLIBC_FULL_BUILD -nostdlibinc -ffixed-point -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wdeprecated -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -nogpulib -fvisibility=hidden -fconvergent-functions -flto -Wno-multi-gpu -Xclang -mcode-object-version=none -DLIBC_COPT_PUBLIC_PACKAGING -UNDEBUG -MD -MT libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalizef16.dir/canonicalizef16.cpp.o -MF libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalizef16.dir/canonicalizef16.cpp.o.d -o libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalizef16.dir/canonicalizef16.cpp.o -c /home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/math/generic/canonicalizef16.cpp
In file included from /home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/math/generic/canonicalizef16.cpp:10:
In file included from /home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/__support/math/canonicalizef16.h:16:
/home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:63:43: error: constexpr function never produces a constant expression [-Winvalid-constexpr]
   63 | template <> LIBC_INLINE constexpr float16 max(float16 x, float16 y) {
      |                                           ^~~
/home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:64:19: note: non-constexpr constructor 'FPBits<_Float16>' cannot be used in a constant expression
   64 |   FPBits<float16> x_bits(x);
      |                   ^
/home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/__support/FPUtil/FPBits.h:839:39: note: declared here
Step 7 (build cmake config) failure: build cmake config (failure)
...
[221/2719] Building CXX object libc/src/math/amdgpu/CMakeFiles/libc.src.math.amdgpu.ceilf.dir/ceilf.cpp.o
[222/2719] Building CXX object libc/src/stdlib/CMakeFiles/libc.src.stdlib.abort.dir/abort.cpp.o
[223/2719] Building CXX object libc/src/stdlib/CMakeFiles/libc.src.stdlib.at_quick_exit.dir/at_quick_exit.cpp.o
[224/2719] Building CXX object libc/src/stdio/gpu/CMakeFiles/libc.src.stdio.gpu.fclose.dir/fclose.cpp.o
[225/2719] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.isnan.dir/isnan.cpp.o
[226/2719] Building CXX object libc/src/stdio/gpu/CMakeFiles/libc.src.stdio.gpu.fread.dir/fread.cpp.o
[227/2719] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.isnanf.dir/isnanf.cpp.o
[228/2719] Building CXX object libc/src/stdio/gpu/CMakeFiles/libc.src.stdio.gpu.puts.dir/puts.cpp.o
[229/2719] Building CXX object libc/src/stdlib/CMakeFiles/libc.src.stdlib.atexit.dir/atexit.cpp.o
[230/2719] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmul.dir/fmul.cpp.o
FAILED: libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmul.dir/fmul.cpp.o 
/home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/build/./bin/clang++ --target=amdgcn-amd-amdhsa -DLIBC_NAMESPACE=__llvm_libc_23_0_0_git -D__LIBC_USE_FLOAT16_CONVERSION -I/home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc -isystem /home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/build/include/amdgcn-amd-amdhsa -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Xclang -fno-pch-timestamp -O3 -DNDEBUG --target=amdgcn-amd-amdhsa -D__LIBC_USE_BUILTIN_ISNAN -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_COPT_STRING_LENGTH_IMPL=element -DLIBC_COPT_FIND_FIRST_CHARACTER_IMPL=element -DLIBC_ADD_NULL_CHECKS "-DLIBC_MATH=(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_INTERMEDIATE_COMP_IN_FLOAT | LIBC_MATH_SMALL_TABLES | LIBC_MATH_NO_ERRNO | LIBC_MATH_NO_EXCEPT)" -fno-math-errno -DLIBC_ERRNO_MODE=LIBC_ERRNO_MODE_SHARED -DLIBC_THREAD_MODE=LIBC_THREAD_MODE_SINGLE -DLIBC_COPT_TIMEOUT_ENSURE_MONOTONICITY -DLIBC_CONF_WCTYPE_MODE=LIBC_WCTYPE_MODE_ASCII -DLIBC_COPT_RAW_MUTEX_DEFAULT_SPIN_COUNT=100 -DLIBC_TARGET_OS_IS_GPU -fpie -DLIBC_FULL_BUILD -nostdlibinc -ffixed-point -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wdeprecated -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -nogpulib -fvisibility=hidden -fconvergent-functions -flto -Wno-multi-gpu -Xclang -mcode-object-version=none -DLIBC_COPT_PUBLIC_PACKAGING -UNDEBUG -MD -MT libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmul.dir/fmul.cpp.o -MF libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmul.dir/fmul.cpp.o.d -o libc/src/math/generic/CMakeFiles/libc.src.math.generic.fmul.dir/fmul.cpp.o -c /home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/math/generic/fmul.cpp
In file included from /home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/math/generic/fmul.cpp:10:
In file included from /home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/__support/math/fmul.h:15:
In file included from /home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/__support/FPUtil/generic/mul.h:16:
/home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:63:43: error: constexpr function never produces a constant expression [-Winvalid-constexpr]
   63 | template <> LIBC_INLINE constexpr float16 max(float16 x, float16 y) {
      |                                           ^~~
/home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:64:19: note: non-constexpr constructor 'FPBits<_Float16>' cannot be used in a constant expression
   64 |   FPBits<float16> x_bits(x);
      |                   ^
/home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/__support/FPUtil/FPBits.h:839:39: note: declared here
  839 |   LIBC_INLINE LIBC_CONSTEXPR explicit FPBits(XType x) {
      |                                       ^
In file included from /home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/math/generic/fmul.cpp:10:
In file included from /home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/__support/math/fmul.h:15:
In file included from /home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/__support/FPUtil/generic/mul.h:16:
/home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:116:43: error: constexpr function never produces a constant expression [-Winvalid-constexpr]
  116 | template <> LIBC_INLINE constexpr float16 min(float16 x, float16 y) {
      |                                           ^~~
/home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:117:19: note: non-constexpr constructor 'FPBits<_Float16>' cannot be used in a constant expression
  117 |   FPBits<float16> x_bits(x);
      |                   ^
/home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/__support/FPUtil/FPBits.h:839:39: note: declared here
  839 |   LIBC_INLINE LIBC_CONSTEXPR explicit FPBits(XType x) {
      |                                       ^
2 errors generated.
[231/2719] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalizef16.dir/canonicalizef16.cpp.o
FAILED: libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalizef16.dir/canonicalizef16.cpp.o 
/home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/build/./bin/clang++ --target=amdgcn-amd-amdhsa -DLIBC_NAMESPACE=__llvm_libc_23_0_0_git -D__LIBC_USE_FLOAT16_CONVERSION -I/home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc -isystem /home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/build/include/amdgcn-amd-amdhsa -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Xclang -fno-pch-timestamp -O3 -DNDEBUG --target=amdgcn-amd-amdhsa -D__LIBC_USE_BUILTIN_ISNAN -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_COPT_STRING_LENGTH_IMPL=element -DLIBC_COPT_FIND_FIRST_CHARACTER_IMPL=element -DLIBC_ADD_NULL_CHECKS "-DLIBC_MATH=(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_INTERMEDIATE_COMP_IN_FLOAT | LIBC_MATH_SMALL_TABLES | LIBC_MATH_NO_ERRNO | LIBC_MATH_NO_EXCEPT)" -fno-math-errno -DLIBC_ERRNO_MODE=LIBC_ERRNO_MODE_SHARED -DLIBC_THREAD_MODE=LIBC_THREAD_MODE_SINGLE -DLIBC_COPT_TIMEOUT_ENSURE_MONOTONICITY -DLIBC_CONF_WCTYPE_MODE=LIBC_WCTYPE_MODE_ASCII -DLIBC_COPT_RAW_MUTEX_DEFAULT_SPIN_COUNT=100 -DLIBC_TARGET_OS_IS_GPU -fpie -DLIBC_FULL_BUILD -nostdlibinc -ffixed-point -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wdeprecated -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -nogpulib -fvisibility=hidden -fconvergent-functions -flto -Wno-multi-gpu -Xclang -mcode-object-version=none -DLIBC_COPT_PUBLIC_PACKAGING -UNDEBUG -MD -MT libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalizef16.dir/canonicalizef16.cpp.o -MF libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalizef16.dir/canonicalizef16.cpp.o.d -o libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalizef16.dir/canonicalizef16.cpp.o -c /home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/math/generic/canonicalizef16.cpp
In file included from /home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/math/generic/canonicalizef16.cpp:10:
In file included from /home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/__support/math/canonicalizef16.h:16:
/home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:63:43: error: constexpr function never produces a constant expression [-Winvalid-constexpr]
   63 | template <> LIBC_INLINE constexpr float16 max(float16 x, float16 y) {
      |                                           ^~~
/home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:64:19: note: non-constexpr constructor 'FPBits<_Float16>' cannot be used in a constant expression
   64 |   FPBits<float16> x_bits(x);
      |                   ^
/home/botworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm-project/libc/src/__support/FPUtil/FPBits.h:839:39: note: declared here

```

</details>

https://github.com/llvm/llvm-project/pull/197479


More information about the libc-commits mailing list