From 4252d7d1f3c7547074b571c404fb182a6469d489 Mon Sep 17 00:00:00 2001 From: TymianekPL Date: Sun, 27 Apr 2025 17:52:18 +0200 Subject: [PATCH 01/38] Add is_implicit_lifetime trait for Clang Signed-off-by: TymianekPL --- stl/inc/type_traits | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/stl/inc/type_traits b/stl/inc/type_traits index 40fb40dff19..94df27a5f65 100644 --- a/stl/inc/type_traits +++ b/stl/inc/type_traits @@ -31,6 +31,16 @@ _STD_BEGIN template constexpr bool _Always_false = false; // TRANSITION, needed by CUDA 12.4 in classes; see CWG-2518, VSO-2016422 (EDG) +#if _HAS_CXX23 && defined(__clang__) + +_EXPORT_STD template +struct is_implicit_lifetime : bool_constant<__builtin_is_implicit_lifetime(_Ty)> {}; + +_EXPORT_STD template +inline constexpr bool is_implicit_lifetime_v = __builtin_is_implicit_lifetime(_Ty); + +#endif // ^^^ Clang + template struct _Conjunction { // handle false trait or last trait using type = _First; From 28f5f81949cac12109a24b7b2276099db34ed39c Mon Sep 17 00:00:00 2001 From: TymianekPL Date: Sun, 27 Apr 2025 19:04:50 +0200 Subject: [PATCH 02/38] Add test Signed-off-by: TymianekPL --- .../P2674R1_is_implicit_lifetime/env.lst | 4 +++ .../test.compile.pass.cpp | 34 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 tests/std/tests/P2674R1_is_implicit_lifetime/env.lst create mode 100644 tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp diff --git a/tests/std/tests/P2674R1_is_implicit_lifetime/env.lst b/tests/std/tests/P2674R1_is_implicit_lifetime/env.lst new file mode 100644 index 00000000000..351a8293d9d --- /dev/null +++ b/tests/std/tests/P2674R1_is_implicit_lifetime/env.lst @@ -0,0 +1,4 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +RUNALL_INCLUDE ..\usual_20_matrix.lst diff --git a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp new file mode 100644 index 00000000000..d10cd490363 --- /dev/null +++ b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include + +enum UnscopedEnum { Enumerator }; +enum struct ScopedEnum { Enumerator }; + +int main() +{ +#ifdef __cpp_lib_is_implicit_lifetime + // this is a test to test whether + // std::is_implicit_lifetime_v produces desired results + // compiles under std namespace + + // Basics + static_assert(std::is_implcit_lifetime_v); + static_assert(std::is_implcit_lifetime_v); + static_assert(std::is_implcit_lifetime_v); + static_assert(std::is_implcit_lifetime_v); + static_assert(std::is_implcit_lifetime_v); + + // Arrays + int n = 20; + static_assert(std::is_implcit_lifetime_v); + static_assert(std::is_implcit_lifetime_v); + static_assert(std::is_implcit_lifetime_v); + + static_assert(!std::is_implcit_lifetime_v); + static_assert(!std::is_implcit_lifetime_v); + static_assert(!std::is_implcit_lifetime_v); + static_assert(!std::is_implcit_lifetime_v); +#endif +} From 58464a74ee2192a90f8f3b3940aefad8b52029c4 Mon Sep 17 00:00:00 2001 From: TymianekPL Date: Sun, 27 Apr 2025 19:05:08 +0200 Subject: [PATCH 03/38] Add feature-test macro Signed-off-by: TymianekPL --- stl/inc/type_traits | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stl/inc/type_traits b/stl/inc/type_traits index 94df27a5f65..c12de3eb090 100644 --- a/stl/inc/type_traits +++ b/stl/inc/type_traits @@ -33,6 +33,8 @@ constexpr bool _Always_false = false; // TRANSITION, needed by CUDA 12.4 in clas #if _HAS_CXX23 && defined(__clang__) +#define __cpp_lib_is_implicit_lifetime 202302L + _EXPORT_STD template struct is_implicit_lifetime : bool_constant<__builtin_is_implicit_lifetime(_Ty)> {}; From b5b56f7242e7806dc34941f12e8aad7f7a05be3a Mon Sep 17 00:00:00 2001 From: Tymianek Date: Tue, 29 Apr 2025 07:36:33 +0200 Subject: [PATCH 04/38] move the macro, remove redundant inline keyword --- stl/inc/type_traits | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/stl/inc/type_traits b/stl/inc/type_traits index c12de3eb090..598777a2777 100644 --- a/stl/inc/type_traits +++ b/stl/inc/type_traits @@ -33,13 +33,11 @@ constexpr bool _Always_false = false; // TRANSITION, needed by CUDA 12.4 in clas #if _HAS_CXX23 && defined(__clang__) -#define __cpp_lib_is_implicit_lifetime 202302L - _EXPORT_STD template struct is_implicit_lifetime : bool_constant<__builtin_is_implicit_lifetime(_Ty)> {}; _EXPORT_STD template -inline constexpr bool is_implicit_lifetime_v = __builtin_is_implicit_lifetime(_Ty); +constexpr bool is_implicit_lifetime_v = __builtin_is_implicit_lifetime(_Ty); #endif // ^^^ Clang From 2162504ff9b07383eaea2a1cb1e2d426f8c6360b Mon Sep 17 00:00:00 2001 From: Tymianek Date: Tue, 29 Apr 2025 07:40:44 +0200 Subject: [PATCH 05/38] Update yvals_core.h --- stl/inc/yvals_core.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index fe1db005f75..4a8641dbf40 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -23,7 +23,7 @@ #error error STL1003: Unexpected compiler, expected C++ compiler. #endif // !defined(__cplusplus) -// Implemented unconditionally: +// Implemented unconditionally // N3911 void_t // N4089 Safe Conversions In unique_ptr // N4169 invoke() @@ -36,7 +36,8 @@ // N4387 Improving pair And tuple // N4389 bool_constant // N4508 shared_mutex (Untimed) -// N4510 Supporting Incomplete Types In vector/list/forward_list +// N4510 Supporting Incomplete Types In vector/list/forward_list +// P2674R1 A trait for implicit lifetime types // P0006R0 Variable Templates For Type Traits (is_same_v, etc.) // P0007R1 as_const() // P0013R1 Logical Operator Type Traits (conjunction, etc.) @@ -1778,7 +1779,10 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect #endif // _HAS_CXX20 // C++23 -#if _HAS_CXX23 +#if _HAS_CXX23 +#ifdef __clang__ // Clang only for now +#define __cpp_lib_is_implicit_lifetime 202302L +#endif #define __cpp_lib_adaptor_iterator_pair_constructor 202106L #define __cpp_lib_allocate_at_least 202302L #define __cpp_lib_associative_heterogeneous_erasure 202110L From 824c116efc24565b8acfdbd5474cd763d61516b8 Mon Sep 17 00:00:00 2001 From: Tymianek Date: Tue, 29 Apr 2025 07:47:43 +0200 Subject: [PATCH 06/38] Add using namespace std and remove VLA test from the P2674 test suite --- .../tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp index d10cd490363..3ba7043119e 100644 --- a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp +++ b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp @@ -6,6 +6,8 @@ enum UnscopedEnum { Enumerator }; enum struct ScopedEnum { Enumerator }; +using namespace std; + int main() { #ifdef __cpp_lib_is_implicit_lifetime @@ -21,10 +23,8 @@ int main() static_assert(std::is_implcit_lifetime_v); // Arrays - int n = 20; static_assert(std::is_implcit_lifetime_v); static_assert(std::is_implcit_lifetime_v); - static_assert(std::is_implcit_lifetime_v); static_assert(!std::is_implcit_lifetime_v); static_assert(!std::is_implcit_lifetime_v); From 9bd93c2bdd1d0cdf8b9d403f99dd0d6915d6fcdf Mon Sep 17 00:00:00 2001 From: Tymianek Date: Tue, 29 Apr 2025 15:33:29 +0200 Subject: [PATCH 07/38] Update type_traits --- stl/inc/type_traits | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stl/inc/type_traits b/stl/inc/type_traits index 598777a2777..f75a5bce8a1 100644 --- a/stl/inc/type_traits +++ b/stl/inc/type_traits @@ -39,7 +39,7 @@ struct is_implicit_lifetime : bool_constant<__builtin_is_implicit_lifetime(_Ty)> _EXPORT_STD template constexpr bool is_implicit_lifetime_v = __builtin_is_implicit_lifetime(_Ty); -#endif // ^^^ Clang +#endif // ^^^ _HAXCXX23 && __clang__ template struct _Conjunction { // handle false trait or last trait From 613f4071601941c5fc658e5478844c6ee7c0f48a Mon Sep 17 00:00:00 2001 From: Tymianek Date: Tue, 29 Apr 2025 15:36:34 +0200 Subject: [PATCH 08/38] Update yvals_core.h --- stl/inc/yvals_core.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index 4a8641dbf40..9468478c1bf 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -23,7 +23,7 @@ #error error STL1003: Unexpected compiler, expected C++ compiler. #endif // !defined(__cplusplus) -// Implemented unconditionally +// Implemented unconditionally: // N3911 void_t // N4089 Safe Conversions In unique_ptr // N4169 invoke() @@ -36,7 +36,7 @@ // N4387 Improving pair And tuple // N4389 bool_constant // N4508 shared_mutex (Untimed) -// N4510 Supporting Incomplete Types In vector/list/forward_list +// N4510 Supporting Incomplete Types In vector/list/forward_list // P2674R1 A trait for implicit lifetime types // P0006R0 Variable Templates For Type Traits (is_same_v, etc.) // P0007R1 as_const() @@ -1779,9 +1779,9 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect #endif // _HAS_CXX20 // C++23 -#if _HAS_CXX23 +#if _HAS_CXX23 #ifdef __clang__ // Clang only for now -#define __cpp_lib_is_implicit_lifetime 202302L +#define __cpp_lib_is_implicit_lifetime 202302L #endif #define __cpp_lib_adaptor_iterator_pair_constructor 202106L #define __cpp_lib_allocate_at_least 202302L From 747f4e8e9012898631341e5389ff939b2b5a3d19 Mon Sep 17 00:00:00 2001 From: TymianekPL Date: Thu, 1 May 2025 16:40:41 +0200 Subject: [PATCH 09/38] More test passes Signed-off-by: TymianekPL --- .../test.compile.pass.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp index 3ba7043119e..a3baf0741f9 100644 --- a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp +++ b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp @@ -5,6 +5,12 @@ enum UnscopedEnum { Enumerator }; enum struct ScopedEnum { Enumerator }; +class Class {}; +class IncompleteClass; +class UserProvidedDestructorClass +{ + ~UserProvidedDestructorClass() {} +}; using namespace std; @@ -17,14 +23,21 @@ int main() // Basics static_assert(std::is_implcit_lifetime_v); + static_assert(std::is_implcit_lifetime_v); static_assert(std::is_implcit_lifetime_v); static_assert(std::is_implcit_lifetime_v); static_assert(std::is_implcit_lifetime_v); static_assert(std::is_implcit_lifetime_v); + static_assert(std::is_implcit_lifetime_v); + static_assert(!std::is_implcit_lifetime_v); + static_assert(!std::is_implcit_lifetime_v); + static_assert(!std::is_implcit_lifetime_v); // Arrays static_assert(std::is_implcit_lifetime_v); static_assert(std::is_implcit_lifetime_v); + static_assert(std::is_implcit_lifetime_v); + static_assert(!std::is_implcit_lifetime_v); static_assert(!std::is_implcit_lifetime_v); static_assert(!std::is_implcit_lifetime_v); @@ -32,3 +45,5 @@ int main() static_assert(!std::is_implcit_lifetime_v); #endif } + +class IncompleteClass {}; \ No newline at end of file From f2fd5370a2f16e90ca339f506e87e1baa9a3c328 Mon Sep 17 00:00:00 2001 From: TymianekPL Date: Thu, 1 May 2025 16:41:51 +0200 Subject: [PATCH 10/38] Remove explicit std resolution path Signed-off-by: TymianekPL --- .../test.compile.pass.cpp | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp index a3baf0741f9..55dd0a70261 100644 --- a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp +++ b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp @@ -18,31 +18,31 @@ int main() { #ifdef __cpp_lib_is_implicit_lifetime // this is a test to test whether - // std::is_implicit_lifetime_v produces desired results + // is_implicit_lifetime_v produces desired results // compiles under std namespace // Basics - static_assert(std::is_implcit_lifetime_v); - static_assert(std::is_implcit_lifetime_v); - static_assert(std::is_implcit_lifetime_v); - static_assert(std::is_implcit_lifetime_v); - static_assert(std::is_implcit_lifetime_v); - static_assert(std::is_implcit_lifetime_v); - static_assert(std::is_implcit_lifetime_v); - static_assert(!std::is_implcit_lifetime_v); - static_assert(!std::is_implcit_lifetime_v); - static_assert(!std::is_implcit_lifetime_v); + static_assert(is_implcit_lifetime_v); + static_assert(is_implcit_lifetime_v); + static_assert(is_implcit_lifetime_v); + static_assert(is_implcit_lifetime_v); + static_assert(is_implcit_lifetime_v); + static_assert(is_implcit_lifetime_v); + static_assert(is_implcit_lifetime_v); + static_assert(!is_implcit_lifetime_v); + static_assert(!is_implcit_lifetime_v); + static_assert(!is_implcit_lifetime_v); // Arrays - static_assert(std::is_implcit_lifetime_v); - static_assert(std::is_implcit_lifetime_v); - static_assert(std::is_implcit_lifetime_v); - static_assert(!std::is_implcit_lifetime_v); - - static_assert(!std::is_implcit_lifetime_v); - static_assert(!std::is_implcit_lifetime_v); - static_assert(!std::is_implcit_lifetime_v); - static_assert(!std::is_implcit_lifetime_v); + static_assert(is_implcit_lifetime_v); + static_assert(is_implcit_lifetime_v); + static_assert(is_implcit_lifetime_v); + static_assert(!is_implcit_lifetime_v); + + static_assert(!is_implcit_lifetime_v); + static_assert(!is_implcit_lifetime_v); + static_assert(!is_implcit_lifetime_v); + static_assert(!is_implcit_lifetime_v); #endif } From a7ff2f9503dc634c1ee009d4f6a507e1cdd6b1d9 Mon Sep 17 00:00:00 2001 From: TymianekPL Date: Thu, 1 May 2025 16:45:10 +0200 Subject: [PATCH 11/38] Add feature-test test Signed-off-by: TymianekPL --- .../VSO_0157762_feature_test_macros/test.compile.pass.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp b/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp index 028d8d68a3a..b6570274880 100644 --- a/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp +++ b/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp @@ -55,6 +55,12 @@ STATIC_ASSERT(__cpp_lib_associative_heterogeneous_erasure == 202110L); #error __cpp_lib_associative_heterogeneous_erasure is defined #endif +#if _HAS_CXX23 && defined(__clang__) +STATIC_ASSERT(__cpp_lib_is_implicit_lifetime == 202302L); +#elif defined(__cpp_lib_is_implicit_lifetime) +#error __cpp_lib_is_implicit_lifetime is defined +#endif + #if _HAS_CXX20 STATIC_ASSERT(__cpp_lib_assume_aligned == 201811L); #elif defined(__cpp_lib_assume_aligned) From 72d311e468dbac182267648f72cc785057ff4efc Mon Sep 17 00:00:00 2001 From: TymianekPL Date: Thu, 1 May 2025 16:47:32 +0200 Subject: [PATCH 12/38] Move implementation comment for P2674R1 in yvals_core.h Signed-off-by: TymianekPL --- stl/inc/yvals_core.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index 9468478c1bf..159e3baa980 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -37,7 +37,6 @@ // N4389 bool_constant // N4508 shared_mutex (Untimed) // N4510 Supporting Incomplete Types In vector/list/forward_list -// P2674R1 A trait for implicit lifetime types // P0006R0 Variable Templates For Type Traits (is_same_v, etc.) // P0007R1 as_const() // P0013R1 Logical Operator Type Traits (conjunction, etc.) @@ -394,8 +393,9 @@ // P2585R1 Improve Default Container Formatting // P2599R2 mdspan: index_type, size_type // P2604R0 mdspan: data_handle_type, data_handle(), exhaustive -// P2613R1 mdspan: empty() +// P2613R1 mdspan: empty() // P2652R2 Disallowing User Specialization Of allocator_traits +// P2674R1 A trait for implicit lifetime types // P2693R1 Formatting thread::id And stacktrace // P2713R1 Escaping Improvements In std::format // P2763R1 Fixing layout_stride's Default Constructor For Fully Static Extents From 51f5433c7175a2974e7c7886431b4dec24c8d9fa Mon Sep 17 00:00:00 2001 From: Tymianek Date: Tue, 16 Sep 2025 07:18:16 +0200 Subject: [PATCH 13/38] [is_implicit_lifetime/test] Fix typos, remove main, rename classes, fix checks --- .../test.compile.pass.cpp | 66 +++++++++---------- 1 file changed, 32 insertions(+), 34 deletions(-) diff --git a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp index 55dd0a70261..03660aed70b 100644 --- a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp +++ b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp @@ -5,45 +5,43 @@ enum UnscopedEnum { Enumerator }; enum struct ScopedEnum { Enumerator }; -class Class {}; class IncompleteClass; -class UserProvidedDestructorClass +struct TrivialClass {}; +struct AggregateClassWithUserProvidedDestructor { - ~UserProvidedDestructorClass() {} + ~AggregateClassWithUserProvidedDestructor() {} }; using namespace std; -int main() -{ #ifdef __cpp_lib_is_implicit_lifetime - // this is a test to test whether - // is_implicit_lifetime_v produces desired results - // compiles under std namespace - - // Basics - static_assert(is_implcit_lifetime_v); - static_assert(is_implcit_lifetime_v); - static_assert(is_implcit_lifetime_v); - static_assert(is_implcit_lifetime_v); - static_assert(is_implcit_lifetime_v); - static_assert(is_implcit_lifetime_v); - static_assert(is_implcit_lifetime_v); - static_assert(!is_implcit_lifetime_v); - static_assert(!is_implcit_lifetime_v); - static_assert(!is_implcit_lifetime_v); - - // Arrays - static_assert(is_implcit_lifetime_v); - static_assert(is_implcit_lifetime_v); - static_assert(is_implcit_lifetime_v); - static_assert(!is_implcit_lifetime_v); - - static_assert(!is_implcit_lifetime_v); - static_assert(!is_implcit_lifetime_v); - static_assert(!is_implcit_lifetime_v); - static_assert(!is_implcit_lifetime_v); +// this is a test to test whether +// is_implicit_lifetime_v produces desired results +// compiles under std namespace + +template +using test_implicit_lifetime = is_implicit_lifetime_v && is_implicit_lifetime::value; + +// Basics (arrays thereof included in Arrays section) +static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime); +static_assert(!test_implicit_lifetime); + +// Arrays +static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime); + +static_assert(!test_implicit_lifetime); +static_assert(!test_implicit_lifetime); +static_assert(!test_implicit_lifetime); +static_assert(!test_implicit_lifetime); #endif -} - -class IncompleteClass {}; \ No newline at end of file From 011f34958df41182e1605286f1622c3ee94a4f10 Mon Sep 17 00:00:00 2001 From: Tymianek Date: Tue, 16 Sep 2025 07:22:50 +0200 Subject: [PATCH 14/38] small typo on the test_implicit_lifetime entity --- .../tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp index 03660aed70b..fed0869c74b 100644 --- a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp +++ b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp @@ -20,7 +20,7 @@ using namespace std; // compiles under std namespace template -using test_implicit_lifetime = is_implicit_lifetime_v && is_implicit_lifetime::value; +constexpr bool test_implicit_lifetime = is_implicit_lifetime_v && is_implicit_lifetime::value; // Basics (arrays thereof included in Arrays section) static_assert(test_implicit_lifetime); @@ -45,3 +45,4 @@ static_assert(!test_implicit_lifetime); static_assert(!test_implicit_lifetime); static_assert(!test_implicit_lifetime); #endif + From 6b51bf8392a8a6424d9fed441fbe7eca0e7100ce Mon Sep 17 00:00:00 2001 From: Tymianek Date: Tue, 16 Sep 2025 07:23:36 +0200 Subject: [PATCH 15/38] format --- .../tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp index fed0869c74b..e1660fda3c1 100644 --- a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp +++ b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp @@ -7,8 +7,7 @@ enum UnscopedEnum { Enumerator }; enum struct ScopedEnum { Enumerator }; class IncompleteClass; struct TrivialClass {}; -struct AggregateClassWithUserProvidedDestructor -{ +struct AggregateClassWithUserProvidedDestructor { ~AggregateClassWithUserProvidedDestructor() {} }; @@ -46,3 +45,4 @@ static_assert(!test_implicit_lifetime); static_assert(!test_implicit_lifetime); #endif + From b0637803a77d022ab9026c829115ffba2d87cb81 Mon Sep 17 00:00:00 2001 From: Tymianek Date: Tue, 16 Sep 2025 07:47:35 +0200 Subject: [PATCH 16/38] remove weird whitespace from yvals core --- stl/inc/yvals_core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index 1ab0aab1645..f845b0a4e88 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -394,7 +394,7 @@ // P2585R1 Improve Default Container Formatting // P2599R2 mdspan: index_type, size_type // P2604R0 mdspan: data_handle_type, data_handle(), exhaustive -// P2613R1 mdspan: empty() +// P2613R1 mdspan: empty() // P2652R2 Disallowing User Specialization Of allocator_traits // P2674R1 A trait for implicit lifetime types // P2693R1 Formatting thread::id And stacktrace From dbd938181c920c41003ce0a7cb53d8b08d65c50a Mon Sep 17 00:00:00 2001 From: Tymianek Date: Tue, 16 Sep 2025 07:56:29 +0200 Subject: [PATCH 17/38] clang-format (test/P2674) --- .../P2674R1_is_implicit_lifetime/test.compile.pass.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp index e1660fda3c1..28ab19d46b8 100644 --- a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp +++ b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp @@ -8,12 +8,12 @@ enum struct ScopedEnum { Enumerator }; class IncompleteClass; struct TrivialClass {}; struct AggregateClassWithUserProvidedDestructor { - ~AggregateClassWithUserProvidedDestructor() {} + ~AggregateClassWithUserProvidedDestructor() {} }; using namespace std; -#ifdef __cpp_lib_is_implicit_lifetime +#ifdef __cpp_lib_is_implicit_lifetime // this is a test to test whether // is_implicit_lifetime_v produces desired results // compiles under std namespace @@ -27,7 +27,7 @@ static_assert(test_implicit_lifetime); static_assert(test_implicit_lifetime); static_assert(test_implicit_lifetime); static_assert(test_implicit_lifetime); -static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime); static_assert(test_implicit_lifetime); static_assert(!test_implicit_lifetime); @@ -46,3 +46,4 @@ static_assert(!test_implicit_lifetime); #endif + From 95d7688579b2854871ca4e2a53b8e92b29eb75d2 Mon Sep 17 00:00:00 2001 From: Tymianek Date: Tue, 16 Sep 2025 07:57:20 +0200 Subject: [PATCH 18/38] clang-format in VSO_0157762_feature_test_macros --- .../VSO_0157762_feature_test_macros/test.compile.pass.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp b/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp index b6570274880..7a675abda4b 100644 --- a/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp +++ b/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp @@ -55,7 +55,7 @@ STATIC_ASSERT(__cpp_lib_associative_heterogeneous_erasure == 202110L); #error __cpp_lib_associative_heterogeneous_erasure is defined #endif -#if _HAS_CXX23 && defined(__clang__) +#if _HAS_CXX23 && defined(__clang__ STATIC_ASSERT(__cpp_lib_is_implicit_lifetime == 202302L); #elif defined(__cpp_lib_is_implicit_lifetime) #error __cpp_lib_is_implicit_lifetime is defined @@ -1044,3 +1044,4 @@ STATIC_ASSERT(__cpp_lib_variant == 202102L); #endif STATIC_ASSERT(__cpp_lib_void_t == 201411L); + From 38db02ef36cd0a8687ca3697ec2db654812dbbb2 Mon Sep 17 00:00:00 2001 From: Tymianek Date: Tue, 16 Sep 2025 08:03:28 +0200 Subject: [PATCH 19/38] remove new-lines from VSO_0157752 --- .../tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp b/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp index 7a675abda4b..0107e9cfbd8 100644 --- a/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp +++ b/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp @@ -1044,4 +1044,3 @@ STATIC_ASSERT(__cpp_lib_variant == 202102L); #endif STATIC_ASSERT(__cpp_lib_void_t == 201411L); - From 7814e558cded6f960aadc2b66ed77e39cd8e2c30 Mon Sep 17 00:00:00 2001 From: Tymianek Date: Tue, 16 Sep 2025 08:04:34 +0200 Subject: [PATCH 20/38] remove new-lines from P2674R1_is_implicit_lifetime --- .../tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp index 28ab19d46b8..679f7781674 100644 --- a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp +++ b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp @@ -44,6 +44,3 @@ static_assert(!test_implicit_lifetime); static_assert(!test_implicit_lifetime); static_assert(!test_implicit_lifetime); #endif - - - From 27a43ca9fbf55e2b2779dfcffcfa6877ef1d982b Mon Sep 17 00:00:00 2001 From: Tymianek Date: Tue, 16 Sep 2025 08:53:50 +0200 Subject: [PATCH 21/38] missing ) --- .../VSO_0157762_feature_test_macros/test.compile.pass.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp b/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp index 0107e9cfbd8..395107830c8 100644 --- a/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp +++ b/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp @@ -55,7 +55,7 @@ STATIC_ASSERT(__cpp_lib_associative_heterogeneous_erasure == 202110L); #error __cpp_lib_associative_heterogeneous_erasure is defined #endif -#if _HAS_CXX23 && defined(__clang__ +#if _HAS_CXX23 && defined(__clang__) STATIC_ASSERT(__cpp_lib_is_implicit_lifetime == 202302L); #elif defined(__cpp_lib_is_implicit_lifetime) #error __cpp_lib_is_implicit_lifetime is defined @@ -1044,3 +1044,4 @@ STATIC_ASSERT(__cpp_lib_variant == 202102L); #endif STATIC_ASSERT(__cpp_lib_void_t == 201411L); + From 685978e0537bdbad9907f058409cc47806b74079 Mon Sep 17 00:00:00 2001 From: Tymianek Date: Tue, 16 Sep 2025 08:59:58 +0200 Subject: [PATCH 22/38] remove whitespace (why is it being added??) --- .../tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp b/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp index 395107830c8..b4dfefda87a 100644 --- a/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp +++ b/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp @@ -1044,4 +1044,3 @@ STATIC_ASSERT(__cpp_lib_variant == 202102L); #endif STATIC_ASSERT(__cpp_lib_void_t == 201411L); - From b2190d22a4e55fb36d5f7194c2a8b970076b2ce9 Mon Sep 17 00:00:00 2001 From: Tymianek Date: Tue, 16 Sep 2025 09:27:03 +0200 Subject: [PATCH 23/38] Add the missing exclamation mark near fp is_implicit_lifetime test --- .../tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp index 679f7781674..4b89a95d265 100644 --- a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp +++ b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp @@ -27,7 +27,7 @@ static_assert(test_implicit_lifetime); static_assert(test_implicit_lifetime); static_assert(test_implicit_lifetime); static_assert(test_implicit_lifetime); -static_assert(test_implicit_lifetime); +static_assert(!test_implicit_lifetime); static_assert(test_implicit_lifetime); static_assert(!test_implicit_lifetime); @@ -44,3 +44,4 @@ static_assert(!test_implicit_lifetime); static_assert(!test_implicit_lifetime); static_assert(!test_implicit_lifetime); #endif + From 26188267eb25413e58d7c6dc33432b7cbdf52521 Mon Sep 17 00:00:00 2001 From: Tymianek Date: Tue, 16 Sep 2025 09:32:06 +0200 Subject: [PATCH 24/38] new-lines. again?! --- .../std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp index 4b89a95d265..08c100f2829 100644 --- a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp +++ b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp @@ -44,4 +44,3 @@ static_assert(!test_implicit_lifetime); static_assert(!test_implicit_lifetime); static_assert(!test_implicit_lifetime); #endif - From 3b9366538642f2473751e0bec70c415cabf73b2c Mon Sep 17 00:00:00 2001 From: TymianekPL Date: Thu, 18 Sep 2025 19:28:22 +0200 Subject: [PATCH 25/38] fix the test P2674R1_is_implicit_lifetime Signed-off-by: TymianekPL --- .../P2674R1_is_implicit_lifetime/test.compile.pass.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp index 08c100f2829..6636ae5c945 100644 --- a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp +++ b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp @@ -7,8 +7,8 @@ enum UnscopedEnum { Enumerator }; enum struct ScopedEnum { Enumerator }; class IncompleteClass; struct TrivialClass {}; -struct AggregateClassWithUserProvidedDestructor { - ~AggregateClassWithUserProvidedDestructor() {} +struct UserProvidedDestructorClass { + ~UserProvidedDestructorClass() {} }; using namespace std; @@ -27,7 +27,7 @@ static_assert(test_implicit_lifetime); static_assert(test_implicit_lifetime); static_assert(test_implicit_lifetime); static_assert(test_implicit_lifetime); -static_assert(!test_implicit_lifetime); +static_assert(test_implicit_lifetime); static_assert(test_implicit_lifetime); static_assert(!test_implicit_lifetime); From 608cb3b326b9c6df68fc830f07b9559035d2443c Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 24 Sep 2025 10:28:11 -0700 Subject: [PATCH 26/38] Clean up paper title. --- stl/inc/yvals_core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index 4c4b35d7863..083d2827866 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -396,7 +396,7 @@ // P2604R0 mdspan: data_handle_type, data_handle(), exhaustive // P2613R1 mdspan: empty() // P2652R2 Disallowing User Specialization Of allocator_traits -// P2674R1 A trait for implicit lifetime types +// P2674R1 is_implicit_lifetime // P2693R1 Formatting thread::id And stacktrace // P2713R1 Escaping Improvements In std::format // P2763R1 Fixing layout_stride's Default Constructor For Fully Static Extents From 8d522a2d4a905cc8d5cb25fbc42fce360e11791e Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 24 Sep 2025 10:28:36 -0700 Subject: [PATCH 27/38] Sort feature-test macro, cite followup issues for MSVC and EDG. --- stl/inc/yvals_core.h | 68 +++++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index 083d2827866..d10bf011a2b 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -1806,9 +1806,6 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect // C++23 #if _HAS_CXX23 -#ifdef __clang__ // Clang only for now -#define __cpp_lib_is_implicit_lifetime 202302L -#endif #define __cpp_lib_adaptor_iterator_pair_constructor 202106L #define __cpp_lib_allocate_at_least 202302L #define __cpp_lib_associative_heterogeneous_erasure 202110L @@ -1827,36 +1824,41 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect #define __cpp_lib_generator 202207L #define __cpp_lib_invoke_r 202106L #define __cpp_lib_ios_noreplace 202207L -#define __cpp_lib_is_scoped_enum 202011L -#define __cpp_lib_mdspan 202207L -#define __cpp_lib_move_only_function 202110L -#define __cpp_lib_out_ptr 202311L -#define __cpp_lib_print 202406L -#define __cpp_lib_ranges_as_const 202311L -#define __cpp_lib_ranges_as_rvalue 202207L -#define __cpp_lib_ranges_cartesian_product 202207L -#define __cpp_lib_ranges_chunk 202202L -#define __cpp_lib_ranges_chunk_by 202202L -#define __cpp_lib_ranges_contains 202207L -#define __cpp_lib_ranges_enumerate 202302L -#define __cpp_lib_ranges_find_last 202207L -#define __cpp_lib_ranges_fold 202207L -#define __cpp_lib_ranges_iota 202202L -#define __cpp_lib_ranges_join_with 202202L -#define __cpp_lib_ranges_repeat 202207L -#define __cpp_lib_ranges_slide 202202L -#define __cpp_lib_ranges_starts_ends_with 202106L -#define __cpp_lib_ranges_stride 202207L -#define __cpp_lib_ranges_to_container 202202L -#define __cpp_lib_ranges_zip 202110L -#define __cpp_lib_spanstream 202106L -#define __cpp_lib_stacktrace 202011L -#define __cpp_lib_stdatomic_h 202011L -#define __cpp_lib_string_contains 202011L -#define __cpp_lib_string_resize_and_overwrite 202110L -#define __cpp_lib_to_underlying 202102L -#define __cpp_lib_tuple_like 202207L -#define __cpp_lib_unreachable 202202L + +#ifdef __clang__ // TRANSITION, GH-5738 tracking VSO-2581622 (MSVC) and VSO-2581623 (EDG) +#define __cpp_lib_is_implicit_lifetime 202302L +#endif // ^^^ no workaround ^^^ + +#define __cpp_lib_is_scoped_enum 202011L +#define __cpp_lib_mdspan 202207L +#define __cpp_lib_move_only_function 202110L +#define __cpp_lib_out_ptr 202311L +#define __cpp_lib_print 202406L +#define __cpp_lib_ranges_as_const 202311L +#define __cpp_lib_ranges_as_rvalue 202207L +#define __cpp_lib_ranges_cartesian_product 202207L +#define __cpp_lib_ranges_chunk 202202L +#define __cpp_lib_ranges_chunk_by 202202L +#define __cpp_lib_ranges_contains 202207L +#define __cpp_lib_ranges_enumerate 202302L +#define __cpp_lib_ranges_find_last 202207L +#define __cpp_lib_ranges_fold 202207L +#define __cpp_lib_ranges_iota 202202L +#define __cpp_lib_ranges_join_with 202202L +#define __cpp_lib_ranges_repeat 202207L +#define __cpp_lib_ranges_slide 202202L +#define __cpp_lib_ranges_starts_ends_with 202106L +#define __cpp_lib_ranges_stride 202207L +#define __cpp_lib_ranges_to_container 202202L +#define __cpp_lib_ranges_zip 202110L +#define __cpp_lib_spanstream 202106L +#define __cpp_lib_stacktrace 202011L +#define __cpp_lib_stdatomic_h 202011L +#define __cpp_lib_string_contains 202011L +#define __cpp_lib_string_resize_and_overwrite 202110L +#define __cpp_lib_to_underlying 202102L +#define __cpp_lib_tuple_like 202207L +#define __cpp_lib_unreachable 202202L #endif // _HAS_CXX23 // macros with language mode sensitivity From 8b7d0ea7d3e4a999136730768c315382179a9940 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 24 Sep 2025 10:35:44 -0700 Subject: [PATCH 28/38] Sort feature-test macro test, cite followup issues for MSVC and EDG. --- .../test.compile.pass.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp b/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp index b4dfefda87a..9402abdf299 100644 --- a/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp +++ b/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp @@ -55,12 +55,6 @@ STATIC_ASSERT(__cpp_lib_associative_heterogeneous_erasure == 202110L); #error __cpp_lib_associative_heterogeneous_erasure is defined #endif -#if _HAS_CXX23 && defined(__clang__) -STATIC_ASSERT(__cpp_lib_is_implicit_lifetime == 202302L); -#elif defined(__cpp_lib_is_implicit_lifetime) -#error __cpp_lib_is_implicit_lifetime is defined -#endif - #if _HAS_CXX20 STATIC_ASSERT(__cpp_lib_assume_aligned == 201811L); #elif defined(__cpp_lib_assume_aligned) @@ -551,6 +545,12 @@ STATIC_ASSERT(__cpp_lib_is_constant_evaluated == 201811L); STATIC_ASSERT(__cpp_lib_is_final == 201402L); +#if _HAS_CXX23 && defined(__clang__) // TRANSITION, GH-5738 tracking VSO-2581622 (MSVC) and VSO-2581623 (EDG) +STATIC_ASSERT(__cpp_lib_is_implicit_lifetime == 202302L); +#elif defined(__cpp_lib_is_implicit_lifetime) +#error __cpp_lib_is_implicit_lifetime is defined +#endif + #if _HAS_CXX17 STATIC_ASSERT(__cpp_lib_is_invocable == 201703L); #elif defined(__cpp_lib_is_invocable) From 0470bad56b14252bfb8b0140774d627643f063c9 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 24 Sep 2025 10:38:52 -0700 Subject: [PATCH 29/38] Add new test to test.lst. --- tests/std/test.lst | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/std/test.lst b/tests/std/test.lst index 247308b4cbc..2cdac46d848 100644 --- a/tests/std/test.lst +++ b/tests/std/test.lst @@ -707,6 +707,7 @@ tests\P2510R3_text_formatting_pointers tests\P2517R1_apply_conditional_noexcept tests\P2538R1_adl_proof_std_projected tests\P2609R3_relaxing_ranges_just_a_smidge +tests\P2674R1_is_implicit_lifetime tests\P2693R1_ostream_and_thread_id tests\P2693R1_text_formatting_header_stacktrace tests\P2693R1_text_formatting_header_thread From 507a9716d767fff6e3c261bff2b31fc91be29933 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 24 Sep 2025 10:39:53 -0700 Subject: [PATCH 30/38] This is a C++23 feature, not C++20. --- tests/std/tests/P2674R1_is_implicit_lifetime/env.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/std/tests/P2674R1_is_implicit_lifetime/env.lst b/tests/std/tests/P2674R1_is_implicit_lifetime/env.lst index 351a8293d9d..642f530ffad 100644 --- a/tests/std/tests/P2674R1_is_implicit_lifetime/env.lst +++ b/tests/std/tests/P2674R1_is_implicit_lifetime/env.lst @@ -1,4 +1,4 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -RUNALL_INCLUDE ..\usual_20_matrix.lst +RUNALL_INCLUDE ..\usual_latest_matrix.lst From 5b87a91711a80a0d1c6173cadc8c2bf6d40d562b Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 24 Sep 2025 10:51:58 -0700 Subject: [PATCH 31/38] Apply no_specializations attributes, follow Standard order, add/fix comments. --- stl/inc/type_traits | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/stl/inc/type_traits b/stl/inc/type_traits index 2cdeceb715c..5b2b160f973 100644 --- a/stl/inc/type_traits +++ b/stl/inc/type_traits @@ -32,16 +32,6 @@ _STD_BEGIN template constexpr bool _Always_false = false; // TRANSITION, needed by CUDA 12.4 in classes; see CWG-2518, VSO-2016422 (EDG) -#if _HAS_CXX23 && defined(__clang__) - -_EXPORT_STD template -struct is_implicit_lifetime : bool_constant<__builtin_is_implicit_lifetime(_Ty)> {}; - -_EXPORT_STD template -constexpr bool is_implicit_lifetime_v = __builtin_is_implicit_lifetime(_Ty); - -#endif // ^^^ _HAXCXX23 && __clang__ - template struct _Conjunction { // handle false trait or last trait using type = _First; @@ -731,6 +721,14 @@ struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_trivially_copyable : bool_constant< _EXPORT_STD template _NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_trivially_copyable_v = __is_trivially_copyable(_Ty); +#if _HAS_CXX23 && defined(__clang__) // TRANSITION, GH-5738 tracking VSO-2581622 (MSVC) and VSO-2581623 (EDG) +_EXPORT_STD template +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_implicit_lifetime : bool_constant<__builtin_is_implicit_lifetime(_Ty)> {}; + +_EXPORT_STD template +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_implicit_lifetime_v = __builtin_is_implicit_lifetime(_Ty); +#endif // ^^^ _HAS_CXX23 && defined(__clang__) ^^^ + _EXPORT_STD template struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS has_virtual_destructor : bool_constant<__has_virtual_destructor(_Ty)> { // determine whether _Ty has a virtual destructor From e82c3548a3f338d1374c52ed0b301936e5ca79c3 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 24 Sep 2025 12:04:25 -0700 Subject: [PATCH 32/38] Test review, part 1: Minor nitpicks. Include `` for `nullptr_t`. Move up the using-directive. Use `enum class`. Rename scoped enumerator to `Enumerator2`. Drop unnecessary comment. Strictly verify both variable template and struct. Add preprocessor comment. --- .../test.compile.pass.cpp | 54 +++++++++---------- 1 file changed, 25 insertions(+), 29 deletions(-) diff --git a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp index 6636ae5c945..cedf2af67d7 100644 --- a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp +++ b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp @@ -1,46 +1,42 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include #include +using namespace std; enum UnscopedEnum { Enumerator }; -enum struct ScopedEnum { Enumerator }; +enum class ScopedEnum { Enumerator2 }; class IncompleteClass; struct TrivialClass {}; struct UserProvidedDestructorClass { ~UserProvidedDestructorClass() {} }; -using namespace std; - #ifdef __cpp_lib_is_implicit_lifetime -// this is a test to test whether -// is_implicit_lifetime_v produces desired results -// compiles under std namespace - -template -constexpr bool test_implicit_lifetime = is_implicit_lifetime_v && is_implicit_lifetime::value; +template +constexpr bool test_implicit_lifetime = is_implicit_lifetime_v == Val && is_implicit_lifetime::value == Val; // Basics (arrays thereof included in Arrays section) -static_assert(test_implicit_lifetime); -static_assert(test_implicit_lifetime); -static_assert(test_implicit_lifetime); -static_assert(test_implicit_lifetime); -static_assert(test_implicit_lifetime); -static_assert(test_implicit_lifetime); -static_assert(test_implicit_lifetime); -static_assert(!test_implicit_lifetime); +static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime); // Arrays -static_assert(test_implicit_lifetime); -static_assert(test_implicit_lifetime); -static_assert(test_implicit_lifetime); -static_assert(test_implicit_lifetime); -static_assert(test_implicit_lifetime); -static_assert(test_implicit_lifetime); - -static_assert(!test_implicit_lifetime); -static_assert(!test_implicit_lifetime); -static_assert(!test_implicit_lifetime); -static_assert(!test_implicit_lifetime); -#endif +static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime); + +static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime); +#endif // ^^^ defined(__cpp_lib_is_implicit_lifetime) ^^^ From 8e7f749989bf02f1e58348cba98b0e068ed315b0 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 24 Sep 2025 12:15:21 -0700 Subject: [PATCH 33/38] Test review, part 2: Consistently test cv-qualifiers. --- .../test.compile.pass.cpp | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp index cedf2af67d7..080448e85b6 100644 --- a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp +++ b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp @@ -16,27 +16,31 @@ struct UserProvidedDestructorClass { #ifdef __cpp_lib_is_implicit_lifetime template constexpr bool test_implicit_lifetime = is_implicit_lifetime_v == Val && is_implicit_lifetime::value == Val; +template +constexpr bool test_implicit_lifetime_cv = test_implicit_lifetime // + && test_implicit_lifetime // + && test_implicit_lifetime // + && test_implicit_lifetime; // Basics (arrays thereof included in Arrays section) -static_assert(test_implicit_lifetime); -static_assert(test_implicit_lifetime); -static_assert(test_implicit_lifetime); -static_assert(test_implicit_lifetime); -static_assert(test_implicit_lifetime); -static_assert(test_implicit_lifetime); -static_assert(test_implicit_lifetime); -static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime_cv); +static_assert(test_implicit_lifetime_cv); +static_assert(test_implicit_lifetime_cv); +static_assert(test_implicit_lifetime_cv); +static_assert(test_implicit_lifetime_cv); +static_assert(test_implicit_lifetime_cv); +static_assert(test_implicit_lifetime_cv); +static_assert(test_implicit_lifetime_cv); // Arrays -static_assert(test_implicit_lifetime); -static_assert(test_implicit_lifetime); -static_assert(test_implicit_lifetime); -static_assert(test_implicit_lifetime); -static_assert(test_implicit_lifetime); -static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime_cv); +static_assert(test_implicit_lifetime_cv); +static_assert(test_implicit_lifetime_cv); +static_assert(test_implicit_lifetime_cv); +static_assert(test_implicit_lifetime_cv); +static_assert(test_implicit_lifetime_cv); -static_assert(test_implicit_lifetime); -static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime_cv); static_assert(test_implicit_lifetime); static_assert(test_implicit_lifetime); #endif // ^^^ defined(__cpp_lib_is_implicit_lifetime) ^^^ From a8a20cb0d9c44f90717146f3b8e5b08d371168db Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 24 Sep 2025 13:27:25 -0700 Subject: [PATCH 34/38] Test review, part 3: More scalars, more unbounded arrays, more references. --- .../test.compile.pass.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp index 080448e85b6..fd48a50bcc4 100644 --- a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp +++ b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp @@ -22,20 +22,27 @@ constexpr bool test_implicit_lifetime_cv = test_implicit_lifetime // && test_implicit_lifetime // && test_implicit_lifetime; -// Basics (arrays thereof included in Arrays section) +// Scalar types, N5014 [basic.types.general]/9 static_assert(test_implicit_lifetime_cv); -static_assert(test_implicit_lifetime_cv); -static_assert(test_implicit_lifetime_cv); static_assert(test_implicit_lifetime_cv); static_assert(test_implicit_lifetime_cv); +static_assert(test_implicit_lifetime_cv); +static_assert(test_implicit_lifetime_cv); static_assert(test_implicit_lifetime_cv); +static_assert(test_implicit_lifetime_cv); +static_assert(test_implicit_lifetime_cv); +static_assert(test_implicit_lifetime_cv); + +// Implicit-lifetime class types, N5014 [class.prop]/16 static_assert(test_implicit_lifetime_cv); static_assert(test_implicit_lifetime_cv); // Arrays static_assert(test_implicit_lifetime_cv); static_assert(test_implicit_lifetime_cv); +static_assert(test_implicit_lifetime_cv); static_assert(test_implicit_lifetime_cv); +static_assert(test_implicit_lifetime_cv); static_assert(test_implicit_lifetime_cv); static_assert(test_implicit_lifetime_cv); static_assert(test_implicit_lifetime_cv); @@ -43,4 +50,6 @@ static_assert(test_implicit_lifetime_cv); static_assert(test_implicit_lifetime_cv); static_assert(test_implicit_lifetime); static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime); +static_assert(test_implicit_lifetime); #endif // ^^^ defined(__cpp_lib_is_implicit_lifetime) ^^^ From 8212b8a17c5016b91fece611521ceeb2e5222ae0 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 24 Sep 2025 15:19:08 -0700 Subject: [PATCH 35/38] Test review, part 4: Expand test coverage of class types, finding a Clang bug! --- .../test.compile.pass.cpp | 100 +++++++++++++++++- 1 file changed, 99 insertions(+), 1 deletion(-) diff --git a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp index fd48a50bcc4..2c151303eec 100644 --- a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp +++ b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include +#include #include using namespace std; @@ -9,9 +10,92 @@ enum UnscopedEnum { Enumerator }; enum class ScopedEnum { Enumerator2 }; class IncompleteClass; struct TrivialClass {}; +struct DefaultedDestructorClass { + ~DefaultedDestructorClass() = default; +}; +struct DeletedDestructorClass { + ~DeletedDestructorClass() = delete; +}; struct UserProvidedDestructorClass { ~UserProvidedDestructorClass() {} }; +struct StringAggregateWithImplicitlyDeclaredDestructor { + string juliette_andromeda_meow; + string clarissa_melpomene_meow; +}; +struct StringAggregateWithUserProvidedDestructor { + string chaos_engine_one; + string chaos_engine_two; + ~StringAggregateWithUserProvidedDestructor() {} +}; + +class NonAggregateWithTrivialCtorAndTrivialDtor { +public: + void set_num(int x) { + num = x; + } + int get_num() const { + return num; + } + +private: + int num; +}; + +class NonAggregateWithNonTrivialCtor { +public: + void set_num(int x) { + num = x; + } + int get_num() const { + return num; + } + +private: + int num{0}; // default member initializer => non-trivial default constructor, N5014 [class.default.ctor]/3.2 +}; + +class NonAggregateWithUserProvidedCtor { +public: + NonAggregateWithUserProvidedCtor() {} + void set_num(int x) { + num = x; + } + int get_num() const { + return num; + } + +private: + int num; +}; + +class NonAggregateWithDeletedDtor { +public: + ~NonAggregateWithDeletedDtor() = delete; + void set_num(int x) { + num = x; + } + int get_num() const { + return num; + } + +private: + int num; +}; + +class NonAggregateWithUserProvidedDtor { +public: + ~NonAggregateWithUserProvidedDtor() {} + void set_num(int x) { + num = x; + } + int get_num() const { + return num; + } + +private: + int num; +}; #ifdef __cpp_lib_is_implicit_lifetime template @@ -33,9 +117,23 @@ static_assert(test_implicit_lifetime_cv); static_assert(test_implicit_lifetime_cv); static_assert(test_implicit_lifetime_cv); -// Implicit-lifetime class types, N5014 [class.prop]/16 +// Implicit-lifetime class types, N5014 [class.prop]/16: +// "A class S is an implicit-lifetime class if +// - it is an aggregate whose destructor is not user-provided or +// - it has at least one trivial eligible constructor and a trivial, non-deleted destructor." static_assert(test_implicit_lifetime_cv); +static_assert(test_implicit_lifetime_cv); +static_assert(test_implicit_lifetime_cv); static_assert(test_implicit_lifetime_cv); +static_assert(test_implicit_lifetime_cv); +static_assert(test_implicit_lifetime_cv); +static_assert(test_implicit_lifetime_cv); +#ifndef __clang__ // TRANSITION, LLVM-160610 +static_assert(test_implicit_lifetime_cv); +static_assert(test_implicit_lifetime_cv); +#endif // ^^^ no workaround ^^^ +static_assert(test_implicit_lifetime_cv); +static_assert(test_implicit_lifetime_cv); // Arrays static_assert(test_implicit_lifetime_cv); From 379791e3209d0c0c2f016beb2201f2907e0dc8bd Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 24 Sep 2025 15:35:09 -0700 Subject: [PATCH 36/38] Update libcxx/expected_results.txt. --- tests/libcxx/expected_results.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/libcxx/expected_results.txt b/tests/libcxx/expected_results.txt index d61fbd35863..ae494bc3c00 100644 --- a/tests/libcxx/expected_results.txt +++ b/tests/libcxx/expected_results.txt @@ -565,9 +565,6 @@ std/utilities/meta/meta.unary/meta.unary.prop/reference_converts_from_temporary. std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp:0 FAIL std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp:1 FAIL -# P2674R1 is_implicit_lifetime -std/utilities/meta/meta.unary/meta.unary.prop/is_implicit_lifetime.pass.cpp FAIL - # P2944R3 Comparisons For reference_wrapper # Add 'std-at-least-c++26' to tests/utils/stl/test/tests.py when beginning work on C++26. std/utilities/function.objects/refwrap/refwrap.comparisons/compare.three_way.refwrap.const_ref.pass.cpp FAIL @@ -583,7 +580,9 @@ std/utilities/optional/optional.iterator/iterator.pass.cpp FAIL # *** MISSING COMPILER FEATURES *** -# None! +# VSO-2581622 C1XX should implement `__builtin_is_implicit_lifetime` +std/utilities/meta/meta.unary/meta.unary.prop/is_implicit_lifetime.pass.cpp:0 FAIL +std/utilities/meta/meta.unary/meta.unary.prop/is_implicit_lifetime.pass.cpp:1 FAIL # *** MISSING LWG ISSUE RESOLUTIONS *** @@ -977,6 +976,9 @@ std/containers/sequences/vector/trivial_relocation.pass.cpp:1 FAIL # Not analyzed, likely bogus test. constexpr fails with "vector iterators incompatible". std/ranges/range.adaptors/range.join.with/range.join.with.iterator/ctor.default.pass.cpp FAIL +# Not analyzed, likely bogus test. Expects tuple to be an implicit-lifetime class type. +std/utilities/meta/meta.unary/meta.unary.prop/is_implicit_lifetime.pass.cpp:2 FAIL + # *** LIKELY STL BUGS *** # Not analyzed, likely STL bugs. Various assertions. From 6092e93dce70352d4c74c07a7d9b17ac55aa8178 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 24 Sep 2025 20:29:06 -0700 Subject: [PATCH 37/38] Make non-aggregates noncopyable to avoid interference from copy ctors. --- .../test.compile.pass.cpp | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp index 2c151303eec..6c4ccd8955d 100644 --- a/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp +++ b/tests/std/tests/P2674R1_is_implicit_lifetime/test.compile.pass.cpp @@ -31,6 +31,12 @@ struct StringAggregateWithUserProvidedDestructor { class NonAggregateWithTrivialCtorAndTrivialDtor { public: + NonAggregateWithTrivialCtorAndTrivialDtor() = default; + ~NonAggregateWithTrivialCtorAndTrivialDtor() = default; + + NonAggregateWithTrivialCtorAndTrivialDtor(const NonAggregateWithTrivialCtorAndTrivialDtor&) = delete; + NonAggregateWithTrivialCtorAndTrivialDtor& operator=(const NonAggregateWithTrivialCtorAndTrivialDtor&) = delete; + void set_num(int x) { num = x; } @@ -44,6 +50,12 @@ class NonAggregateWithTrivialCtorAndTrivialDtor { class NonAggregateWithNonTrivialCtor { public: + NonAggregateWithNonTrivialCtor() = default; + ~NonAggregateWithNonTrivialCtor() = default; + + NonAggregateWithNonTrivialCtor(const NonAggregateWithNonTrivialCtor&) = delete; + NonAggregateWithNonTrivialCtor& operator=(const NonAggregateWithNonTrivialCtor&) = delete; + void set_num(int x) { num = x; } @@ -58,6 +70,11 @@ class NonAggregateWithNonTrivialCtor { class NonAggregateWithUserProvidedCtor { public: NonAggregateWithUserProvidedCtor() {} + ~NonAggregateWithUserProvidedCtor() = default; + + NonAggregateWithUserProvidedCtor(const NonAggregateWithUserProvidedCtor&) = delete; + NonAggregateWithUserProvidedCtor& operator=(const NonAggregateWithUserProvidedCtor&) = delete; + void set_num(int x) { num = x; } @@ -71,7 +88,12 @@ class NonAggregateWithUserProvidedCtor { class NonAggregateWithDeletedDtor { public: + NonAggregateWithDeletedDtor() = default; ~NonAggregateWithDeletedDtor() = delete; + + NonAggregateWithDeletedDtor(const NonAggregateWithDeletedDtor&) = delete; + NonAggregateWithDeletedDtor& operator=(const NonAggregateWithDeletedDtor&) = delete; + void set_num(int x) { num = x; } @@ -85,7 +107,12 @@ class NonAggregateWithDeletedDtor { class NonAggregateWithUserProvidedDtor { public: + NonAggregateWithUserProvidedDtor() = default; ~NonAggregateWithUserProvidedDtor() {} + + NonAggregateWithUserProvidedDtor(const NonAggregateWithUserProvidedDtor&) = delete; + NonAggregateWithUserProvidedDtor& operator=(const NonAggregateWithUserProvidedDtor&) = delete; + void set_num(int x) { num = x; } From bd0d861282c6a320d03bad93bb66c1b4aece324a Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 24 Sep 2025 20:36:06 -0700 Subject: [PATCH 38/38] Cite LLVM-160627. --- tests/libcxx/expected_results.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/libcxx/expected_results.txt b/tests/libcxx/expected_results.txt index ae494bc3c00..edf67dce1fb 100644 --- a/tests/libcxx/expected_results.txt +++ b/tests/libcxx/expected_results.txt @@ -61,6 +61,9 @@ std/language.support/support.exception/except.nested/ctor_default.pass.cpp:2 SKI # SKIPPED because this is ARM64EC-specific. std/language.support/support.coroutines/coroutine.handle/coroutine.handle.noop/noop_coroutine.pass.cpp:2 SKIPPED +# LLVM-160627: [libc++][test] Guard non-guaranteed implicit-lifetime-ness cases with _LIBCPP_VERSION +std/utilities/meta/meta.unary/meta.unary.prop/is_implicit_lifetime.pass.cpp:2 FAIL + # Non-Standard regex behavior. # "It seems likely that the test is still non-conforming due to how libc++ handles the 'w' character class." std/re/re.traits/lookup_classname.pass.cpp FAIL @@ -976,9 +979,6 @@ std/containers/sequences/vector/trivial_relocation.pass.cpp:1 FAIL # Not analyzed, likely bogus test. constexpr fails with "vector iterators incompatible". std/ranges/range.adaptors/range.join.with/range.join.with.iterator/ctor.default.pass.cpp FAIL -# Not analyzed, likely bogus test. Expects tuple to be an implicit-lifetime class type. -std/utilities/meta/meta.unary/meta.unary.prop/is_implicit_lifetime.pass.cpp:2 FAIL - # *** LIKELY STL BUGS *** # Not analyzed, likely STL bugs. Various assertions.