Skip to content

[libc++][type_traits] P2674R1: A trait for implicit lifetime types #106870

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

H-G-Hristov
Copy link
Contributor

@H-G-Hristov H-G-Hristov commented Aug 31, 2024

Implements P2674R1: https://wg21.link/P2674R1

Implementation details:

References:

Closes: #105259

Copy link

github-actions bot commented Aug 31, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

@H-G-Hristov H-G-Hristov force-pushed the hgh/libcxx/P2647R1-A-trait-for-implicit-lifetime-types branch 2 times, most recently from 43241f6 to 0ab51dc Compare August 31, 2024 20:39
Copy link

github-actions bot commented Aug 31, 2024

✅ With the latest revision this PR passed the Python code formatter.

@H-G-Hristov H-G-Hristov force-pushed the hgh/libcxx/P2647R1-A-trait-for-implicit-lifetime-types branch from 0ab51dc to 4e995ac Compare August 31, 2024 20:50
@MitalAshok
Copy link
Contributor

The implementation without the builtin can never be implemented correctly for all structs. You wouldn't be able to check if this class has a trivial default constructor:

struct X {
  X() = default;  // Trivial eligible constructor
  X(int = 0);  // ... But X is not default constructible
  X(const X&);
};

static_assert(__builtin_is_implicit_lifetime(X));
static_assert(!is_implicit_lifetime_v<X>);

Not sure you should try to provide a fallback in the !__has_builtin case.

(But if you do keep it, you don't check if it's a class before you check trivially_destructible&&(trivially_X_constructible||...). This allows extension types like double _Complex and int [[vector_size(4)]], but does not deny references like int& which are not implicit lifetime)

@Zingam Zingam changed the title [libc++][type_traits] P2647R1: A trait for implicit lifetime types [libc++][type_traits] P2674R1: A trait for implicit lifetime types Aug 31, 2024
@Zingam
Copy link
Contributor

Zingam commented Aug 31, 2024

The implementation without the builtin can never be implemented correctly for all structs. You wouldn't be able to check if this class has a trivial default constructor:

struct X {
  X() = default;  // Trivial eligible constructor
  X(int = 0);  // ... But X is not default constructible
  X(const X&);
};

static_assert(__builtin_is_implicit_lifetime(X));
static_assert(!is_implicit_lifetime_v<X>);

Not sure you should try to provide a fallback in the !__has_builtin case.

(But if you do keep it, you don't check if it's a class before you check trivially_destructible&&(trivially_X_constructible||...). This allows extension types like double _Complex and int [[vector_size(4)]], but does not deny references like int& which are not implicit lifetime)

Thanks for the review. I plan to remove the non-builtin implementation.

@H-G-Hristov H-G-Hristov force-pushed the hgh/libcxx/P2647R1-A-trait-for-implicit-lifetime-types branch 4 times, most recently from 4cf8ca3 to 4799114 Compare August 31, 2024 22:04
@Zingam
Copy link
Contributor

Zingam commented Sep 3, 2024

For the record: I encountered the following issue #106864 while implementing #105259.

@H-G-Hristov H-G-Hristov force-pushed the hgh/libcxx/P2647R1-A-trait-for-implicit-lifetime-types branch from 4799114 to 02e288f Compare September 3, 2024 14:22
Implements P2674R1: https://wg21.link/P2674R1

- https://eel.is/c++draft/type.traits
  - https://eel.is/c++draft/meta.type.synop
  - https://eel.is/c++draft/meta.unary.prop
- https://eel.is/c++draft/support.limits
  - https://eel.is/c++draft/version.syn

Implementation details:
- Uses compiler intrinsic `__builtin_is_implicit_lifetime`:
  - llvm#101807
- Tests based on:
    - https://github.com/llvm/llvm-project/blob/d213981c80626698a07b11ce872acba098a863d4/clang/test/SemaCXX/type-traits.cpp#L1989

References:
- Implicit-lifetime
  - Implicit-lifetime types [basic.types.general]/9: https://eel.is/c++draft/basic.types.general
  - Implicit-lifetime class [class.prop]/9: https://eel.is/c++draft/class.prop
- P0593R6 Implicit creation of objects for low-level object manipulation: https://wg21.link/P0593R6
- P1010R1 Container support for implicit lifetime types: https://wg21.link/P1010R1
- P0593R6 Implicit creation of objects for low-level object manipulation: https://wg21.link/P0593R6

Closes: llvm#105259
@H-G-Hristov H-G-Hristov force-pushed the hgh/libcxx/P2647R1-A-trait-for-implicit-lifetime-types branch from 02e288f to c8ae04b Compare September 3, 2024 15:23
@Zingam
Copy link
Contributor

Zingam commented Sep 3, 2024

Strange build failure with macOS back deployment: https://buildkite.com/llvm-project/libcxx-ci/builds/37470#0191b844-f2b4-4102-b33f-e633e18147c7

@Zingam Zingam marked this pull request as ready for review September 3, 2024 17:48
@Zingam Zingam requested a review from a team as a code owner September 3, 2024 17:48
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Sep 3, 2024
@llvmbot
Copy link
Member

llvmbot commented Sep 3, 2024

@llvm/pr-subscribers-libcxx

Author: Hristo Hristov (H-G-Hristov)

Changes

Implements P2674R1: https://wg21.link/P2674R1

Implementation details:

References:

Closes: #105259


Patch is 30.39 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/106870.diff

14 Files Affected:

  • (modified) libcxx/docs/FeatureTestMacroTable.rst (+2)
  • (modified) libcxx/docs/ReleaseNotes/20.rst (+1)
  • (modified) libcxx/docs/Status/Cxx23Papers.csv (+1-1)
  • (modified) libcxx/include/CMakeLists.txt (+1)
  • (added) libcxx/include/__type_traits/is_implicit_lifetime.h (+35)
  • (modified) libcxx/include/module.modulemap (+1)
  • (modified) libcxx/include/type_traits (+8)
  • (modified) libcxx/include/version (+4)
  • (modified) libcxx/modules/std/type_traits.inc (+6-2)
  • (modified) libcxx/test/std/language.support/support.limits/support.limits.general/type_traits.version.compile.pass.cpp (+43)
  • (modified) libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp (+43)
  • (added) libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_implicit_lifetime.pass.cpp (+323)
  • (added) libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_implicit_lifetime.verify.cpp (+33)
  • (modified) libcxx/utils/generate_feature_test_macro_components.py (+7)
diff --git a/libcxx/docs/FeatureTestMacroTable.rst b/libcxx/docs/FeatureTestMacroTable.rst
index c909a4300db1a6..05b08da5215350 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -336,6 +336,8 @@ Status
     ---------------------------------------------------------- -----------------
     ``__cpp_lib_ios_noreplace``                                ``202207L``
     ---------------------------------------------------------- -----------------
+    ``__cpp_lib_is_implicit_lifetime``                         ``202302L``
+    ---------------------------------------------------------- -----------------
     ``__cpp_lib_is_scoped_enum``                               ``202011L``
     ---------------------------------------------------------- -----------------
     ``__cpp_lib_mdspan``                                       ``202207L``
diff --git a/libcxx/docs/ReleaseNotes/20.rst b/libcxx/docs/ReleaseNotes/20.rst
index 93d6027291ad95..cb95d7059eb837 100644
--- a/libcxx/docs/ReleaseNotes/20.rst
+++ b/libcxx/docs/ReleaseNotes/20.rst
@@ -41,6 +41,7 @@ Implemented Papers
 - P2747R2: ``constexpr`` placement new (`Github <https://github.com/llvm/llvm-project/issues/105427>`__)
 - P2609R3: Relaxing Ranges Just A Smidge (`Github <https://github.com/llvm/llvm-project/issues/105253>`__)
 - P2985R0: A type trait for detecting virtual base classes (`Github <https://github.com/llvm/llvm-project/issues/105432>`__)
+- P2674R1: A trait for implicit lifetime types (`Github <https://github.com/llvm/llvm-project/issues/105259>`__)
 
 
 Improvements and New Features
diff --git a/libcxx/docs/Status/Cxx23Papers.csv b/libcxx/docs/Status/Cxx23Papers.csv
index 2c8a91d8401b53..2cf63b29ab53ba 100644
--- a/libcxx/docs/Status/Cxx23Papers.csv
+++ b/libcxx/docs/Status/Cxx23Papers.csv
@@ -113,7 +113,7 @@
 "`P2572R1 <https://wg21.link/P2572R1>`__","``std::format`` fill character allowances","2023-02 (Issaquah)","|Complete|","17.0",""
 "`P2693R1 <https://wg21.link/P2693R1>`__","Formatting ``thread::id`` and ``stacktrace``","2023-02 (Issaquah)","|Partial|","","The formatter for ``stacktrace`` is not implemented, since ``stacktrace`` is not implemented yet"
 "`P2679R2 <https://wg21.link/P2679R2>`__","Fixing ``std::start_lifetime_as`` for arrays","2023-02 (Issaquah)","","",""
-"`P2674R1 <https://wg21.link/P2674R1>`__","A trait for implicit lifetime types","2023-02 (Issaquah)","","",""
+"`P2674R1 <https://wg21.link/P2674R1>`__","A trait for implicit lifetime types","2023-02 (Issaquah)","|Complete|","20.0",""
 "`P2655R3 <https://wg21.link/P2655R3>`__","``common_reference_t`` of ``reference_wrapper`` Should Be a Reference Type","2023-02 (Issaquah)","","",""
 "`P2652R2 <https://wg21.link/P2652R2>`__","Disallow User Specialization of ``allocator_traits``","2023-02 (Issaquah)","|Complete|","19.0",""
 "`P2787R1 <https://wg21.link/P2787R1>`__","``pmr::generator`` - Promise Types are not Values","2023-02 (Issaquah)","","",""
diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index 32579272858a8e..6c755e90214b44 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -778,6 +778,7 @@ set(files
   __type_traits/is_floating_point.h
   __type_traits/is_function.h
   __type_traits/is_fundamental.h
+  __type_traits/is_implicit_lifetime.h
   __type_traits/is_implicitly_default_constructible.h
   __type_traits/is_integral.h
   __type_traits/is_literal_type.h
diff --git a/libcxx/include/__type_traits/is_implicit_lifetime.h b/libcxx/include/__type_traits/is_implicit_lifetime.h
new file mode 100644
index 00000000000000..2aba420bd2b59d
--- /dev/null
+++ b/libcxx/include/__type_traits/is_implicit_lifetime.h
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___TYPE_TRAITS_IS_IMPLICIT_LIFETIME_H
+#define _LIBCPP___TYPE_TRAITS_IS_IMPLICIT_LIFETIME_H
+
+#include <__config>
+#include <__type_traits/integral_constant.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 23
+#  if __has_builtin(__builtin_is_implicit_lifetime)
+
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_implicit_lifetime : public bool_constant<__builtin_is_implicit_lifetime(_Tp)> {};
+
+template <class _Tp>
+inline constexpr bool is_implicit_lifetime_v = __builtin_is_implicit_lifetime(_Tp);
+
+#  endif
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___TYPE_TRAITS_IS_IMPLICIT_LIFETIME_H
diff --git a/libcxx/include/module.modulemap b/libcxx/include/module.modulemap
index f193b5d95f49f5..da3fa1cbaa66ba 100644
--- a/libcxx/include/module.modulemap
+++ b/libcxx/include/module.modulemap
@@ -1944,6 +1944,7 @@ module std_private_type_traits_is_final                                  [system
 module std_private_type_traits_is_floating_point                         [system] { header "__type_traits/is_floating_point.h" }
 module std_private_type_traits_is_function                               [system] { header "__type_traits/is_function.h" }
 module std_private_type_traits_is_fundamental                            [system] { header "__type_traits/is_fundamental.h" }
+module std_private_type_traits_is_implicit_lifetime                      [system] { header "__type_traits/is_implicit_lifetime.h" }
 module std_private_type_traits_is_implicitly_default_constructible       [system] {
   header "__type_traits/is_implicitly_default_constructible.h"
   export std_private_type_traits_integral_constant
diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits
index 5937d4fdc9e1a7..d29721a371c39a 100644
--- a/libcxx/include/type_traits
+++ b/libcxx/include/type_traits
@@ -137,6 +137,8 @@ namespace std
     template <class T>                struct is_nothrow_swappable;      // C++17
     template <class T>                struct is_nothrow_destructible;
 
+    template<class T> struct is_implicit_lifetime;                     // Since C++23
+
     template <class T> struct has_virtual_destructor;
 
     template<class T> struct has_unique_object_representations;         // C++17
@@ -374,6 +376,8 @@ namespace std
         = is_nothrow_swappable<T>::value;                               // C++17
       template <class T> inline constexpr bool is_nothrow_destructible_v
         = is_nothrow_destructible<T>::value;                             // C++17
+      template<class T>
+        constexpr bool is_implicit_lifetime_v = is_implicit_lifetime<T>::value;   // Since C++23
       template <class T> inline constexpr bool has_virtual_destructor_v
         = has_virtual_destructor<T>::value;                              // C++17
       template<class T> inline constexpr bool has_unique_object_representations_v // C++17
@@ -517,6 +521,10 @@ namespace std
 #  include <__type_traits/unwrap_ref.h>
 #endif
 
+#if _LIBCPP_STD_VER >= 23
+#  include <__type_traits/is_implicit_lifetime.h>
+#endif
+
 #include <version>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
diff --git a/libcxx/include/version b/libcxx/include/version
index dc1d3fd268ce83..482913b2759c9b 100644
--- a/libcxx/include/version
+++ b/libcxx/include/version
@@ -138,6 +138,7 @@ __cpp_lib_ios_noreplace                                 202207L <ios>
 __cpp_lib_is_aggregate                                  201703L <type_traits>
 __cpp_lib_is_constant_evaluated                         201811L <type_traits>
 __cpp_lib_is_final                                      201402L <type_traits>
+__cpp_lib_is_implicit_lifetime                          202302L <type_traits>
 __cpp_lib_is_invocable                                  201703L <type_traits>
 __cpp_lib_is_layout_compatible                          201907L <type_traits>
 __cpp_lib_is_nothrow_convertible                        201806L <type_traits>
@@ -473,6 +474,9 @@ __cpp_lib_void_t                                        201411L <type_traits>
 # define __cpp_lib_forward_like                         202207L
 # define __cpp_lib_invoke_r                             202106L
 # define __cpp_lib_ios_noreplace                        202207L
+# if __has_builtin(__builtin_is_implicit_lifetime)
+#   define __cpp_lib_is_implicit_lifetime               202302L
+# endif
 # define __cpp_lib_is_scoped_enum                       202011L
 # define __cpp_lib_mdspan                               202207L
 # define __cpp_lib_modules                              202207L
diff --git a/libcxx/modules/std/type_traits.inc b/libcxx/modules/std/type_traits.inc
index d368daf35ccb8c..d7b5a7243746b2 100644
--- a/libcxx/modules/std/type_traits.inc
+++ b/libcxx/modules/std/type_traits.inc
@@ -98,7 +98,9 @@ export namespace std {
 
   using std::is_nothrow_destructible;
 
-  //  using std::is_implicit_lifetime;
+#if _LIBCPP_STD_VER >= 23 && __has_builtin(__builtin_is_implicit_lifetime)
+  using std::is_implicit_lifetime;
+#endif
 
   using std::has_virtual_destructor;
 
@@ -243,7 +245,9 @@ export namespace std {
   using std::is_destructible_v;
   using std::is_empty_v;
   using std::is_final_v;
-  // using std::is_implicit_lifetime_v;
+#if _LIBCPP_STD_VER >= 23 && __has_builtin(__builtin_is_implicit_lifetime)
+  using std::is_implicit_lifetime_v;
+#endif
   using std::is_move_assignable_v;
   using std::is_move_constructible_v;
   using std::is_nothrow_assignable_v;
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/type_traits.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/type_traits.version.compile.pass.cpp
index 1cbf2699a95bcc..d9d698ace2b653 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/type_traits.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/type_traits.version.compile.pass.cpp
@@ -23,6 +23,7 @@
     __cpp_lib_is_aggregate                         201703L [C++17]
     __cpp_lib_is_constant_evaluated                201811L [C++20]
     __cpp_lib_is_final                             201402L [C++14]
+    __cpp_lib_is_implicit_lifetime                 202302L [C++23]
     __cpp_lib_is_invocable                         201703L [C++17]
     __cpp_lib_is_layout_compatible                 201907L [C++20]
     __cpp_lib_is_nothrow_convertible               201806L [C++20]
@@ -75,6 +76,10 @@
 #   error "__cpp_lib_is_final should not be defined before c++14"
 # endif
 
+# ifdef __cpp_lib_is_implicit_lifetime
+#   error "__cpp_lib_is_implicit_lifetime should not be defined before c++23"
+# endif
+
 # ifdef __cpp_lib_is_invocable
 #   error "__cpp_lib_is_invocable should not be defined before c++17"
 # endif
@@ -179,6 +184,10 @@
 #   error "__cpp_lib_is_final should have the value 201402L in c++14"
 # endif
 
+# ifdef __cpp_lib_is_implicit_lifetime
+#   error "__cpp_lib_is_implicit_lifetime should not be defined before c++23"
+# endif
+
 # ifdef __cpp_lib_is_invocable
 #   error "__cpp_lib_is_invocable should not be defined before c++17"
 # endif
@@ -301,6 +310,10 @@
 #   error "__cpp_lib_is_final should have the value 201402L in c++17"
 # endif
 
+# ifdef __cpp_lib_is_implicit_lifetime
+#   error "__cpp_lib_is_implicit_lifetime should not be defined before c++23"
+# endif
+
 # ifndef __cpp_lib_is_invocable
 #   error "__cpp_lib_is_invocable should be defined in c++17"
 # endif
@@ -444,6 +457,10 @@
 #   error "__cpp_lib_is_final should have the value 201402L in c++20"
 # endif
 
+# ifdef __cpp_lib_is_implicit_lifetime
+#   error "__cpp_lib_is_implicit_lifetime should not be defined before c++23"
+# endif
+
 # ifndef __cpp_lib_is_invocable
 #   error "__cpp_lib_is_invocable should be defined in c++20"
 # endif
@@ -614,6 +631,19 @@
 #   error "__cpp_lib_is_final should have the value 201402L in c++23"
 # endif
 
+# if __has_builtin(__builtin_is_implicit_lifetime)
+#   ifndef __cpp_lib_is_implicit_lifetime
+#     error "__cpp_lib_is_implicit_lifetime should be defined in c++23"
+#   endif
+#   if __cpp_lib_is_implicit_lifetime != 202302L
+#     error "__cpp_lib_is_implicit_lifetime should have the value 202302L in c++23"
+#   endif
+# else
+#   ifdef __cpp_lib_is_implicit_lifetime
+#     error "__cpp_lib_is_implicit_lifetime should not be defined when the requirement '__has_builtin(__builtin_is_implicit_lifetime)' is not met!"
+#   endif
+# endif
+
 # ifndef __cpp_lib_is_invocable
 #   error "__cpp_lib_is_invocable should be defined in c++23"
 # endif
@@ -796,6 +826,19 @@
 #   error "__cpp_lib_is_final should have the value 201402L in c++26"
 # endif
 
+# if __has_builtin(__builtin_is_implicit_lifetime)
+#   ifndef __cpp_lib_is_implicit_lifetime
+#     error "__cpp_lib_is_implicit_lifetime should be defined in c++26"
+#   endif
+#   if __cpp_lib_is_implicit_lifetime != 202302L
+#     error "__cpp_lib_is_implicit_lifetime should have the value 202302L in c++26"
+#   endif
+# else
+#   ifdef __cpp_lib_is_implicit_lifetime
+#     error "__cpp_lib_is_implicit_lifetime should not be defined when the requirement '__has_builtin(__builtin_is_implicit_lifetime)' is not met!"
+#   endif
+# endif
+
 # ifndef __cpp_lib_is_invocable
 #   error "__cpp_lib_is_invocable should be defined in c++26"
 # endif
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
index a022c90e166c8d..10cf69f67c39f9 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
@@ -125,6 +125,7 @@
     __cpp_lib_is_aggregate                                  201703L [C++17]
     __cpp_lib_is_constant_evaluated                         201811L [C++20]
     __cpp_lib_is_final                                      201402L [C++14]
+    __cpp_lib_is_implicit_lifetime                          202302L [C++23]
     __cpp_lib_is_invocable                                  201703L [C++17]
     __cpp_lib_is_layout_compatible                          201907L [C++20]
     __cpp_lib_is_nothrow_convertible                        201806L [C++20]
@@ -671,6 +672,10 @@
 #   error "__cpp_lib_is_final should not be defined before c++14"
 # endif
 
+# ifdef __cpp_lib_is_implicit_lifetime
+#   error "__cpp_lib_is_implicit_lifetime should not be defined before c++23"
+# endif
+
 # ifdef __cpp_lib_is_invocable
 #   error "__cpp_lib_is_invocable should not be defined before c++17"
 # endif
@@ -1550,6 +1555,10 @@
 #   error "__cpp_lib_is_final should have the value 201402L in c++14"
 # endif
 
+# ifdef __cpp_lib_is_implicit_lifetime
+#   error "__cpp_lib_is_implicit_lifetime should not be defined before c++23"
+# endif
+
 # ifdef __cpp_lib_is_invocable
 #   error "__cpp_lib_is_invocable should not be defined before c++17"
 # endif
@@ -2564,6 +2573,10 @@
 #   error "__cpp_lib_is_final should have the value 201402L in c++17"
 # endif
 
+# ifdef __cpp_lib_is_implicit_lifetime
+#   error "__cpp_lib_is_implicit_lifetime should not be defined before c++23"
+# endif
+
 # ifndef __cpp_lib_is_invocable
 #   error "__cpp_lib_is_invocable should be defined in c++17"
 # endif
@@ -3842,6 +3855,10 @@
 #   error "__cpp_lib_is_final should have the value 201402L in c++20"
 # endif
 
+# ifdef __cpp_lib_is_implicit_lifetime
+#   error "__cpp_lib_is_implicit_lifetime should not be defined before c++23"
+# endif
+
 # ifndef __cpp_lib_is_invocable
 #   error "__cpp_lib_is_invocable should be defined in c++20"
 # endif
@@ -5306,6 +5323,19 @@
 #   error "__cpp_lib_is_final should have the value 201402L in c++23"
 # endif
 
+# if __has_builtin(__builtin_is_implicit_lifetime)
+#   ifndef __cpp_lib_is_implicit_lifetime
+#     error "__cpp_lib_is_implicit_lifetime should be defined in c++23"
+#   endif
+#   if __cpp_lib_is_implicit_lifetime != 202302L
+#     error "__cpp_lib_is_implicit_lifetime should have the value 202302L in c++23"
+#   endif
+# else
+#   ifdef __cpp_lib_is_implicit_lifetime
+#     error "__cpp_lib_is_implicit_lifetime should not be defined when the requirement '__has_builtin(__builtin_is_implicit_lifetime)' is not met!"
+#   endif
+# endif
+
 # ifndef __cpp_lib_is_invocable
 #   error "__cpp_lib_is_invocable should be defined in c++23"
 # endif
@@ -7112,6 +7142,19 @@
 #   error "__cpp_lib_is_final should have the value 201402L in c++26"
 # endif
 
+# if __has_builtin(__builtin_is_implicit_lifetime)
+#   ifndef __cpp_lib_is_implicit_lifetime
+#     error "__cpp_lib_is_implicit_lifetime should be defined in c++26"
+#   endif
+#   if __cpp_lib_is_implicit_lifetime != 202302L
+#     error "__cpp_lib_is_implicit_lifetime should have the value 202302L in c++26"
+#   endif
+# else
+#   ifdef __cpp_lib_is_implicit_lifetime
+#     error "__cpp_lib_is_implicit_lifetime should not be defined when the requirement '__has_builtin(__builtin_is_implicit_lifetime)' is not met!"
+#   endif
+# endif
+
 # ifndef __cpp_lib_is_invocable
 #   error "__cpp_lib_is_invocable should be defined in c++26"
 # endif
diff --git a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_implicit_lifetime.pass.cpp b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_implicit_lifetime.pass.cpp
new file mode 100644
index 00000000000000..2b8d00ea577455
--- /dev/null
+++ b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_implicit_lifetime.pass.cpp
@@ -0,0 +1,323 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
+
+// These compilers don't support __builtin_is_implicit_lifetime yet.
+// UNSUPPORTED: clang-17, clang-18, clang-19, gcc-14, apple-clang-16, apple-clang-17
+// XFAIL: apple-clang
+
+// <type_traits>
+
+// template<class T> struct is_implicit_lifetime;
+
+#include <cassert>
+#include <cstddef>
+#include <tuple>
+#include <type_traits>
+#include <utility>
+
+#include "test_macros.h"
+
+enum Enum { EV };
+enum SignedEnum : signed int {};
+enum UnsignedEnum : unsigned int {};
+
+enum class EnumClass { EV };
+enum class SignedEnumClass : signed int {};
+enum class UnsignedEnumClass : unsigned int {};
+
+struct EmptyStruct {};
+struct IncompleteStruct;
+
+struct NoEligibleTrivialContructor {
+  NoEligibleTrivialContructor() {};
+  NoEligibleTrivialContructor(const NoEligibleTrivialContructor&) {}
+  NoEligibleTrivialContructor(NoEligibleTrivialContructor&&) {}
+};
+
+struct OnlyDefaultConstructorIsTrivial {
+  OnlyDefaultConstructorIsTrivial() = default;
+  OnlyDefaultConstructorIsTrivial(const OnlyDefaultConstructorIsTrivial&) {}
+  OnlyDefaultConstructorIsTrivial(OnlyDefaultConstructorIsTrivial&&) {}
+};
+
+struct AllContstructorsAreTrivial {
+  AllContstructorsAreTrivial()                                  = default;
+  AllContstructorsAreTrivial(const AllContstructorsAreTrivial&) = default;
+  AllContstructorsAreTrivial(AllContstructorsAreTrivial&&)      = default;
+};
+
+struct InheritedNoEligibleTrivialConstructor : NoEligibleTrivialContructor {
+  using NoEligibleTrivialContructor::NoEligibleTrivialContructor;
+};
+
+struct InheritedOnlyDefaultConstructorIsTrivial : OnlyDefaultConstructorIsTrivial {
+  using OnlyDefaultConstructorIsTrivial::OnlyDefaultConstructorIsTrivial;
+};
+
+struct InheritedAllContstructorsAreTrivial : AllContstructorsAreTrivial {
+  using AllContstructorsAreTrivial::AllContstructorsAreTrivial;
+};
+
+struct UserDeclaredDestructor {
+  ~UserDeclaredDestructor() = default;
+};
+
+struct UserProvidedDestructor {
+  ~UserProvidedDestructor() {}
+};
+
+struct UserDeletedDestructorInAggregate {
+  ~UserDeletedDestructorInAggregate() = delete;
+};
+
+struct UserDeletedDestructorInNonAggregate {
+  virtual void NonAggregate();
+  ~UserDeletedDestructorInNonAggregate() = dele...
[truncated]

Copy link
Member

@ldionne ldionne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments but this looks really good!

@Zingam
Copy link
Contributor

Zingam commented Sep 5, 2024

LGTM, please wait for @philnik777 's approval before merging.

Thank you for the review. I think the CI is not using Clang-20 with the builtin yet and I should wait for the CI to be updated before I merge. WDYT?

Comment on lines 201 to 207
export std_core.type_traits.integral_constant
}
module is_implicit_lifetime {
header "__type_traits/is_implicit_lifetime.h"
export std_core.type_traits.is_implicit_lifetime
}
module is_implicitly_default_constructible {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ldionne The new module map required this PR to be updated. Could you please reapprove the above change?

@Zingam
Copy link
Contributor

Zingam commented Oct 8, 2024

@philnik777 I addressed your comments. I checked std::atomic as you asked and it passes the trait in runtime context. I'm not sure if we need such tests so I didn't include any.

Copy link
Contributor

@philnik777 philnik777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically LGTM except for the modulemap.

@Zingam
Copy link
Contributor

Zingam commented Oct 8, 2024

I guess this PR will have to be updated with the changes from #111522

@philnik777 philnik777 merged commit a06591b into llvm:main Oct 9, 2024
65 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 9, 2024

LLVM Buildbot has detected a new failure on builder sanitizer-x86_64-linux-android running on sanitizer-buildbot-android while building libcxx at step 2 "annotate".

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

Here is the relevant piece of the build log for the reference
Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...
PASS: SanitizerCommon-asan-arm-Android :: Posix/dedup_token_length_test.cpp (281 of 1533)
PASS: UBSan-Standalone-arm :: TestCases/Integer/sub-overflow.cpp (282 of 1533)
PASS: AddressSanitizer-arm-android :: TestCases/Posix/unpoison-alternate-stack.cpp (283 of 1533)
PASS: UBSan-Standalone-arm :: TestCases/Integer/uadd-overflow.cpp (284 of 1533)
PASS: AddressSanitizer-arm-android :: TestCases/invalid-free.cpp (285 of 1533)
PASS: AddressSanitizer-arm-android :: TestCases/Linux/malloc_delete_mismatch.cpp (286 of 1533)
PASS: UBSan-Standalone-arm :: TestCases/Integer/negate-overflow.cpp (287 of 1533)
PASS: UBSan-AddressSanitizer-arm :: TestCases/Integer/sub-overflow.cpp (288 of 1533)
PASS: AddressSanitizer-arm-android :: TestCases/Posix/fake_stack_gc.cpp (289 of 1533)
XFAIL: AddressSanitizer-arm-android :: TestCases/Posix/glob.cpp (290 of 1533)
FAIL: AddressSanitizer-arm-android :: TestCases/Linux/syscalls.cpp (291 of 1533)
******************** TEST 'AddressSanitizer-arm-android :: TestCases/Linux/syscalls.cpp' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/sanitizer_common/android_commands/android_compile.py  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/bin/clang  --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only  --target=armv7-linux-androideabi24 --sysroot=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --gcc-toolchain=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64  -B/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta  -fuse-ld=lld  -shared-libasan -O0 /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/Linux/syscalls.cpp -o /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp && not  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp 2>&1 | FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/Linux/syscalls.cpp
+ /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/sanitizer_common/android_commands/android_compile.py /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/bin/clang --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only --target=armv7-linux-androideabi24 --sysroot=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --gcc-toolchain=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -B/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta -fuse-ld=lld -shared-libasan -O0 /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/Linux/syscalls.cpp -o /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp
+ not /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp
+ FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/Linux/syscalls.cpp
/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/Linux/syscalls.cpp:18:12: error: CHECK: expected string not found in input
 // CHECK: AddressSanitizer: stack-buffer-{{.*}}erflow
           ^
<stdin>:1:1: note: scanning from here
adb command failed ['shell', 'cd /data/local/tmp/Output && LD_LIBRARY_PATH=/data/local/tmp/Output ASAN_OPTIONS="abort_on_error=0" /data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp >/data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp.stdout 2>/data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp.stderr ; echo $? >/data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp.exitcode']
^
<stdin>:1:165: note: possible intended match here
adb command failed ['shell', 'cd /data/local/tmp/Output && LD_LIBRARY_PATH=/data/local/tmp/Output ASAN_OPTIONS="abort_on_error=0" /data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp >/data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp.stdout 2>/data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp.stderr ; echo $? >/data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp.exitcode']
                                                                                                                                                                    ^

Input file: <stdin>
Check file: /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/Linux/syscalls.cpp

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: adb command failed ['shell', 'cd /data/local/tmp/Output && LD_LIBRARY_PATH=/data/local/tmp/Output ASAN_OPTIONS="abort_on_error=0" /data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp >/data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp.stdout 2>/data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp.stderr ; echo $? >/data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp.exitcode'] 
check:18'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
check:18'1                                                                                                                                                                         ?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             possible intended match
            2: /tmp/lit-tmp-yd3xgum8/tmp1npjg1kq 
check:18'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            3:  
check:18'0     ~
>>>>>>

--

********************
Step 26 (run lit tests [arm/bluejay-userdebug/TQ3A.230805.001]) failure: run lit tests [arm/bluejay-userdebug/TQ3A.230805.001] (failure)
...
PASS: SanitizerCommon-asan-arm-Android :: Posix/dedup_token_length_test.cpp (281 of 1533)
PASS: UBSan-Standalone-arm :: TestCases/Integer/sub-overflow.cpp (282 of 1533)
PASS: AddressSanitizer-arm-android :: TestCases/Posix/unpoison-alternate-stack.cpp (283 of 1533)
PASS: UBSan-Standalone-arm :: TestCases/Integer/uadd-overflow.cpp (284 of 1533)
PASS: AddressSanitizer-arm-android :: TestCases/invalid-free.cpp (285 of 1533)
PASS: AddressSanitizer-arm-android :: TestCases/Linux/malloc_delete_mismatch.cpp (286 of 1533)
PASS: UBSan-Standalone-arm :: TestCases/Integer/negate-overflow.cpp (287 of 1533)
PASS: UBSan-AddressSanitizer-arm :: TestCases/Integer/sub-overflow.cpp (288 of 1533)
PASS: AddressSanitizer-arm-android :: TestCases/Posix/fake_stack_gc.cpp (289 of 1533)
XFAIL: AddressSanitizer-arm-android :: TestCases/Posix/glob.cpp (290 of 1533)
FAIL: AddressSanitizer-arm-android :: TestCases/Linux/syscalls.cpp (291 of 1533)
******************** TEST 'AddressSanitizer-arm-android :: TestCases/Linux/syscalls.cpp' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/sanitizer_common/android_commands/android_compile.py  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/bin/clang  --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only  --target=armv7-linux-androideabi24 --sysroot=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --gcc-toolchain=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64  -B/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta  -fuse-ld=lld  -shared-libasan -O0 /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/Linux/syscalls.cpp -o /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp && not  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp 2>&1 | FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/Linux/syscalls.cpp
+ /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/sanitizer_common/android_commands/android_compile.py /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/bin/clang --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only --target=armv7-linux-androideabi24 --sysroot=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --gcc-toolchain=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -B/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta -fuse-ld=lld -shared-libasan -O0 /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/Linux/syscalls.cpp -o /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp
+ not /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp
+ FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/Linux/syscalls.cpp
/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/Linux/syscalls.cpp:18:12: error: CHECK: expected string not found in input
 // CHECK: AddressSanitizer: stack-buffer-{{.*}}erflow
           ^
<stdin>:1:1: note: scanning from here
adb command failed ['shell', 'cd /data/local/tmp/Output && LD_LIBRARY_PATH=/data/local/tmp/Output ASAN_OPTIONS="abort_on_error=0" /data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp >/data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp.stdout 2>/data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp.stderr ; echo $? >/data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp.exitcode']
^
<stdin>:1:165: note: possible intended match here
adb command failed ['shell', 'cd /data/local/tmp/Output && LD_LIBRARY_PATH=/data/local/tmp/Output ASAN_OPTIONS="abort_on_error=0" /data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp >/data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp.stdout 2>/data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp.stderr ; echo $? >/data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp.exitcode']
                                                                                                                                                                    ^

Input file: <stdin>
Check file: /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/Linux/syscalls.cpp

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: adb command failed ['shell', 'cd /data/local/tmp/Output && LD_LIBRARY_PATH=/data/local/tmp/Output ASAN_OPTIONS="abort_on_error=0" /data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp >/data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp.stdout 2>/data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp.stderr ; echo $? >/data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Linux/Output/syscalls.cpp.tmp.exitcode'] 
check:18'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
check:18'1                                                                                                                                                                         ?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             possible intended match
            2: /tmp/lit-tmp-yd3xgum8/tmp1npjg1kq 
check:18'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            3:  
check:18'0     ~
>>>>>>

--

********************

@ldionne
Copy link
Member

ldionne commented Oct 9, 2024

Modulemap changes look good to me.

I looked at the sanitizer buildbot thing above and I can't find anything in the logs.

Edit: Looks like I am blind, now that I found the failures they don't look related to this change.

@H-G-Hristov H-G-Hristov deleted the hgh/libcxx/P2647R1-A-trait-for-implicit-lifetime-types branch February 13, 2025 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

P2674R1: A trait for implicit lifetime types
9 participants