[libcxx-commits] [libcxx] [libc++][NFC] Rename is_trivially_relocatable.h to is_relocatable.h (PR #218650)
via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Aug 25 04:30:44 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: Nikolas Klauser (philnik777)
<details>
<summary>Changes</summary>
Sooner or later we're going to introduce `__is_nothrow_relocatable_v`, which we'll want to put in the same header as `__is_trivially_relocatable_v`. Rename `is_trivially_relocatable.h` to `is_relocatable.h` to keep the header name correct.
---
Full diff: https://github.com/llvm/llvm-project/pull/218650.diff
17 Files Affected:
- (modified) libcxx/include/CMakeLists.txt (+1-1)
- (modified) libcxx/include/__expected/expected.h (+1-1)
- (modified) libcxx/include/__memory/uninitialized_algorithms.h (+1-1)
- (modified) libcxx/include/__memory/unique_ptr.h (+1-1)
- (modified) libcxx/include/__optional/optional.h (+1-1)
- (modified) libcxx/include/__optional/optional_ref.h (-1)
- (modified) libcxx/include/__split_buffer (+1-1)
- (renamed) libcxx/include/__type_traits/is_relocatable.h (+3-3)
- (modified) libcxx/include/__utility/pair.h (+1-1)
- (modified) libcxx/include/__vector/vector.h (+1-1)
- (modified) libcxx/include/array (+1-1)
- (modified) libcxx/include/deque (+1-1)
- (modified) libcxx/include/module.modulemap.in (+4-4)
- (modified) libcxx/include/string (+1-1)
- (modified) libcxx/include/tuple (+1-1)
- (modified) libcxx/include/variant (+1-1)
- (modified) libcxx/test/libcxx/type_traits/is_trivially_relocatable.compile.pass.cpp (+1-1)
``````````diff
diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index d717a7354c62b..f0caccdc94194 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -905,6 +905,7 @@ set(files
__type_traits/is_polymorphic.h
__type_traits/is_reference.h
__type_traits/is_reference_wrapper.h
+ __type_traits/is_relocatable.h
__type_traits/is_same.h
__type_traits/is_scalar.h
__type_traits/is_signed.h
@@ -917,7 +918,6 @@ set(files
__type_traits/is_trivially_copyable.h
__type_traits/is_trivially_destructible.h
__type_traits/is_trivially_lexicographically_comparable.h
- __type_traits/is_trivially_relocatable.h
__type_traits/is_union.h
__type_traits/is_unqualified.h
__type_traits/is_unsigned.h
diff --git a/libcxx/include/__expected/expected.h b/libcxx/include/__expected/expected.h
index 987ccf628c814..5588196939738 100644
--- a/libcxx/include/__expected/expected.h
+++ b/libcxx/include/__expected/expected.h
@@ -31,11 +31,11 @@
#include <__type_traits/is_nothrow_assignable.h>
#include <__type_traits/is_nothrow_constructible.h>
#include <__type_traits/is_reference.h>
+#include <__type_traits/is_relocatable.h>
#include <__type_traits/is_same.h>
#include <__type_traits/is_swappable.h>
#include <__type_traits/is_trivially_constructible.h>
#include <__type_traits/is_trivially_destructible.h>
-#include <__type_traits/is_trivially_relocatable.h>
#include <__type_traits/is_void.h>
#include <__type_traits/negation.h>
#include <__type_traits/remove_cv.h>
diff --git a/libcxx/include/__memory/uninitialized_algorithms.h b/libcxx/include/__memory/uninitialized_algorithms.h
index fb648d7b355a3..82a7a20be4007 100644
--- a/libcxx/include/__memory/uninitialized_algorithms.h
+++ b/libcxx/include/__memory/uninitialized_algorithms.h
@@ -27,10 +27,10 @@
#include <__type_traits/is_constant_evaluated.h>
#include <__type_traits/is_nothrow_constructible.h>
#include <__type_traits/is_reference.h>
+#include <__type_traits/is_relocatable.h>
#include <__type_traits/is_same.h>
#include <__type_traits/is_trivially_assignable.h>
#include <__type_traits/is_trivially_constructible.h>
-#include <__type_traits/is_trivially_relocatable.h>
#include <__type_traits/remove_const.h>
#include <__utility/exception_guard.h>
#include <__utility/move.h>
diff --git a/libcxx/include/__memory/unique_ptr.h b/libcxx/include/__memory/unique_ptr.h
index c8392d35c352f..01820aa52b533 100644
--- a/libcxx/include/__memory/unique_ptr.h
+++ b/libcxx/include/__memory/unique_ptr.h
@@ -37,9 +37,9 @@
#include <__type_traits/is_function.h>
#include <__type_traits/is_pointer.h>
#include <__type_traits/is_reference.h>
+#include <__type_traits/is_relocatable.h>
#include <__type_traits/is_same.h>
#include <__type_traits/is_swappable.h>
-#include <__type_traits/is_trivially_relocatable.h>
#include <__type_traits/is_void.h>
#include <__type_traits/nat.h>
#include <__type_traits/reference_converts_from_temporary.h>
diff --git a/libcxx/include/__optional/optional.h b/libcxx/include/__optional/optional.h
index 7c2ab7574e8cb..b53cedc380cc6 100644
--- a/libcxx/include/__optional/optional.h
+++ b/libcxx/include/__optional/optional.h
@@ -40,13 +40,13 @@
#include <__type_traits/is_nothrow_constructible.h>
#include <__type_traits/is_object.h>
#include <__type_traits/is_reference.h>
+#include <__type_traits/is_relocatable.h>
#include <__type_traits/is_same.h>
#include <__type_traits/is_scalar.h>
#include <__type_traits/is_swappable.h>
#include <__type_traits/is_trivially_assignable.h>
#include <__type_traits/is_trivially_constructible.h>
#include <__type_traits/is_trivially_destructible.h>
-#include <__type_traits/is_trivially_relocatable.h>
#include <__type_traits/negation.h>
#include <__type_traits/remove_cv.h>
#include <__type_traits/remove_cvref.h>
diff --git a/libcxx/include/__optional/optional_ref.h b/libcxx/include/__optional/optional_ref.h
index 2fa8c474212e7..20270e0594df5 100644
--- a/libcxx/include/__optional/optional_ref.h
+++ b/libcxx/include/__optional/optional_ref.h
@@ -32,7 +32,6 @@
#include <__type_traits/is_object.h>
#include <__type_traits/is_reference.h>
#include <__type_traits/is_same.h>
-#include <__type_traits/is_trivially_relocatable.h>
#include <__type_traits/reference_constructs_from_temporary.h>
#include <__type_traits/remove_cv.h>
#include <__type_traits/remove_cvref.h>
diff --git a/libcxx/include/__split_buffer b/libcxx/include/__split_buffer
index 59cee84536069..d89264186d77e 100644
--- a/libcxx/include/__split_buffer
+++ b/libcxx/include/__split_buffer
@@ -31,9 +31,9 @@
#include <__type_traits/integral_constant.h>
#include <__type_traits/is_nothrow_assignable.h>
#include <__type_traits/is_nothrow_constructible.h>
+#include <__type_traits/is_relocatable.h>
#include <__type_traits/is_swappable.h>
#include <__type_traits/is_trivially_destructible.h>
-#include <__type_traits/is_trivially_relocatable.h>
#include <__utility/forward.h>
#include <__utility/move.h>
diff --git a/libcxx/include/__type_traits/is_trivially_relocatable.h b/libcxx/include/__type_traits/is_relocatable.h
similarity index 91%
rename from libcxx/include/__type_traits/is_trivially_relocatable.h
rename to libcxx/include/__type_traits/is_relocatable.h
index 11d7d5c153678..cfbe1966a67b2 100644
--- a/libcxx/include/__type_traits/is_trivially_relocatable.h
+++ b/libcxx/include/__type_traits/is_relocatable.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_RELOCATABLE_H
-#define _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_RELOCATABLE_H
+#ifndef _LIBCPP___TYPE_TRAITS_IS_RELOCATABLE_H
+#define _LIBCPP___TYPE_TRAITS_IS_RELOCATABLE_H
#include <__config>
#include <__type_traits/enable_if.h>
@@ -45,4 +45,4 @@ inline const bool
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_RELOCATABLE_H
+#endif // _LIBCPP___TYPE_TRAITS_IS_RELOCATABLE_H
diff --git a/libcxx/include/__utility/pair.h b/libcxx/include/__utility/pair.h
index f9d4599a5068d..a65c178a9f036 100644
--- a/libcxx/include/__utility/pair.h
+++ b/libcxx/include/__utility/pair.h
@@ -31,8 +31,8 @@
#include <__type_traits/is_implicitly_default_constructible.h>
#include <__type_traits/is_nothrow_assignable.h>
#include <__type_traits/is_nothrow_constructible.h>
+#include <__type_traits/is_relocatable.h>
#include <__type_traits/is_swappable.h>
-#include <__type_traits/is_trivially_relocatable.h>
#include <__type_traits/nat.h>
#include <__type_traits/unwrap_ref.h>
#include <__utility/declval.h>
diff --git a/libcxx/include/__vector/vector.h b/libcxx/include/__vector/vector.h
index ebcfcc17d4b6d..e23bd8999e48a 100644
--- a/libcxx/include/__vector/vector.h
+++ b/libcxx/include/__vector/vector.h
@@ -55,9 +55,9 @@
#include <__type_traits/is_nothrow_assignable.h>
#include <__type_traits/is_nothrow_constructible.h>
#include <__type_traits/is_pointer.h>
+#include <__type_traits/is_relocatable.h>
#include <__type_traits/is_same.h>
#include <__type_traits/is_swappable.h>
-#include <__type_traits/is_trivially_relocatable.h>
#include <__type_traits/remove_const_ref.h>
#include <__type_traits/type_identity.h>
#include <__utility/declval.h>
diff --git a/libcxx/include/array b/libcxx/include/array
index 851a220e87398..470e268e75466 100644
--- a/libcxx/include/array
+++ b/libcxx/include/array
@@ -134,9 +134,9 @@ template <size_t I, class T, size_t N> const T&& get(const array<T, N>&&) noexce
# include <__type_traits/is_const.h>
# include <__type_traits/is_constructible.h>
# include <__type_traits/is_nothrow_constructible.h>
+# include <__type_traits/is_relocatable.h>
# include <__type_traits/is_same.h>
# include <__type_traits/is_swappable.h>
-# include <__type_traits/is_trivially_relocatable.h>
# include <__type_traits/remove_cv.h>
# include <__utility/empty.h>
# include <__utility/integer_sequence.h>
diff --git a/libcxx/include/deque b/libcxx/include/deque
index b83da0b29da56..bcd9d9bb4a6dd 100644
--- a/libcxx/include/deque
+++ b/libcxx/include/deque
@@ -228,9 +228,9 @@ template <class T, class Allocator, class Predicate>
# include <__type_traits/is_convertible.h>
# include <__type_traits/is_nothrow_assignable.h>
# include <__type_traits/is_nothrow_constructible.h>
+# include <__type_traits/is_relocatable.h>
# include <__type_traits/is_same.h>
# include <__type_traits/is_swappable.h>
-# include <__type_traits/is_trivially_relocatable.h>
# include <__type_traits/type_identity.h>
# include <__utility/exception_guard.h>
# include <__utility/forward.h>
diff --git a/libcxx/include/module.modulemap.in b/libcxx/include/module.modulemap.in
index 78f4e08d9c282..9ce0c49b8b2b3 100644
--- a/libcxx/include/module.modulemap.in
+++ b/libcxx/include/module.modulemap.in
@@ -267,6 +267,10 @@ module std_core {
header "__type_traits/is_reference.h"
export std_core.type_traits.integral_constant
}
+ module is_relocatable {
+ header "__type_traits/is_relocatable.h"
+ export std_core.type_traits.integral_constant
+ }
module is_same {
header "__type_traits/is_same.h"
export std_core.type_traits.integral_constant
@@ -315,10 +319,6 @@ module std_core {
header "__type_traits/is_trivially_lexicographically_comparable.h"
export std_core.type_traits.integral_constant
}
- module is_trivially_relocatable {
- header "__type_traits/is_trivially_relocatable.h"
- export std_core.type_traits.integral_constant
- }
module is_union {
header "__type_traits/is_union.h"
export std_core.type_traits.integral_constant
diff --git a/libcxx/include/string b/libcxx/include/string
index 2ded71b45a8b4..8b0b648d2c655 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -637,11 +637,11 @@ basic_string<char32_t> operator""s( const char32_t *str, size_t len );
# include <__type_traits/is_generic_transparent_comparator.h>
# include <__type_traits/is_nothrow_assignable.h>
# include <__type_traits/is_nothrow_constructible.h>
+# include <__type_traits/is_relocatable.h>
# include <__type_traits/is_same.h>
# include <__type_traits/is_standard_layout.h>
# include <__type_traits/is_trivially_constructible.h>
# include <__type_traits/is_trivially_copyable.h>
-# include <__type_traits/is_trivially_relocatable.h>
# include <__type_traits/remove_cv.h>
# include <__type_traits/remove_cvref.h>
# include <__utility/default_three_way_comparator.h>
diff --git a/libcxx/include/tuple b/libcxx/include/tuple
index 7de15da8fab84..67fd59b07c3e1 100644
--- a/libcxx/include/tuple
+++ b/libcxx/include/tuple
@@ -252,9 +252,9 @@ template <class... Types>
# include <__type_traits/is_nothrow_assignable.h>
# include <__type_traits/is_nothrow_constructible.h>
# include <__type_traits/is_reference.h>
+# include <__type_traits/is_relocatable.h>
# include <__type_traits/is_same.h>
# include <__type_traits/is_swappable.h>
-# include <__type_traits/is_trivially_relocatable.h>
# include <__type_traits/maybe_const.h>
# include <__type_traits/nat.h>
# include <__type_traits/negation.h>
diff --git a/libcxx/include/variant b/libcxx/include/variant
index d9d615478ab80..393aea461af9f 100644
--- a/libcxx/include/variant
+++ b/libcxx/include/variant
@@ -246,12 +246,12 @@ namespace std {
# include <__type_traits/is_nothrow_assignable.h>
# include <__type_traits/is_nothrow_constructible.h>
# include <__type_traits/is_reference.h>
+# include <__type_traits/is_relocatable.h>
# include <__type_traits/is_same.h>
# include <__type_traits/is_swappable.h>
# include <__type_traits/is_trivially_assignable.h>
# include <__type_traits/is_trivially_constructible.h>
# include <__type_traits/is_trivially_destructible.h>
-# include <__type_traits/is_trivially_relocatable.h>
# include <__type_traits/is_void.h>
# include <__type_traits/remove_const.h>
# include <__type_traits/remove_cvref.h>
diff --git a/libcxx/test/libcxx/type_traits/is_trivially_relocatable.compile.pass.cpp b/libcxx/test/libcxx/type_traits/is_trivially_relocatable.compile.pass.cpp
index 27961cbab57ba..66b71f7fd366a 100644
--- a/libcxx/test/libcxx/type_traits/is_trivially_relocatable.compile.pass.cpp
+++ b/libcxx/test/libcxx/type_traits/is_trivially_relocatable.compile.pass.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include <__type_traits/is_trivially_relocatable.h>
+#include <__type_traits/is_relocatable.h>
#include <array>
#include <deque>
#include <exception>
``````````
</details>
https://github.com/llvm/llvm-project/pull/218650
More information about the libcxx-commits
mailing list