[libc-commits] [libc] [libc] Fix shared math for gcc-7 or older compatibility. (PR #197476)

Jordan Rupprecht via libc-commits libc-commits at lists.llvm.org
Thu May 14 06:51:39 PDT 2026


================
@@ -0,0 +1,63 @@
+//===------------------------------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// \file
+// This file contains a free-standing implementation of is_assignable
+// type trait.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SRC___SUPPORT_CPP_TYPE_TRAITS_IS_ASSIGNABLE_H
+#define LLVM_LIBC_SRC___SUPPORT_CPP_TYPE_TRAITS_IS_ASSIGNABLE_H
+
+#include "src/__support/CPP/type_traits/integral_constant.h"
+#include "src/__support/CPP/utility/declval.h"
+#include "src/__support/macros/attributes.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace cpp {
+
+namespace is_assignable_detail {
+
+#if LIBC_HAS_BUILTIN_IS_ASSIGNABLE
+
+template <typename T, typename U>
+struct is_assignable_impl : public bool_constant<__is_assignable(T, U)> {};
----------------
rupprecht wrote:

Looks like you include integral_constant.h but meant to include bool_constant.h?
```
llvm-project/libc/src/__support/CPP/type_traits/is_assignable.h:31:36: error: no template named 'bool_constant'
   31 | struct is_assignable_impl : public bool_constant<__is_assignable(T, U)> {};
```

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


More information about the libc-commits mailing list