From 05928c7bb837b376fb85c53702ea8e37453d6651 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Tue, 26 Dec 2023 01:28:20 +0800 Subject: [PATCH 1/2] Fix constraints of `shared_ptr`'s constructors --- stl/inc/memory | 14 +++++++++++--- tests/libcxx/expected_results.txt | 6 ------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/stl/inc/memory b/stl/inc/memory index d982b01e72f..8417fbc8b5f 100644 --- a/stl/inc/memory +++ b/stl/inc/memory @@ -1464,12 +1464,20 @@ struct _Can_call_function_object : false_type {}; template struct _Can_call_function_object<_Fx, _Arg, void_t()(_STD declval<_Arg>()))>> : true_type {}; -template +template struct _SP_convertible : is_convertible<_Yty*, _Ty*>::type {}; + +template +struct _SP_convertible<_Yty, _Uty[], _Void> : false_type {}; template -struct _SP_convertible<_Yty, _Uty[]> : is_convertible<_Yty (*)[], _Uty (*)[]>::type {}; +struct _SP_convertible<_Yty, _Uty[], void_t(nullptr))>> + : is_convertible<_Yty (*)[], _Uty (*)[]>::type {}; + +template +struct _SP_convertible<_Yty, _Uty[_Ext], _Void> : false_type {}; template -struct _SP_convertible<_Yty, _Uty[_Ext]> : is_convertible<_Yty (*)[_Ext], _Uty (*)[_Ext]>::type {}; +struct _SP_convertible<_Yty, _Uty[_Ext], void_t(nullptr))>> + : is_convertible<_Yty (*)[_Ext], _Uty (*)[_Ext]>::type {}; template struct _SP_pointer_compatible : is_convertible<_Yty*, _Ty*>::type { diff --git a/tests/libcxx/expected_results.txt b/tests/libcxx/expected_results.txt index aa7119f94a3..b2cc503f326 100644 --- a/tests/libcxx/expected_results.txt +++ b/tests/libcxx/expected_results.txt @@ -1231,12 +1231,6 @@ std/strings/char.traits/char.traits.specializations/char.traits.specializations. # The Standard depicts `atomic& operator=(const atomic&) volatile = delete;` which we seem to be missing. std/atomics/atomics.types.generic/atomics.types.float/copy.compile.pass.cpp FAIL -# Not analyzed. -# MSVC error C2087: 'abstract declarator': missing subscript -# Clang error: array has incomplete element type 'int[]' -std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer.pass.cpp FAIL -std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.mod/reset_pointer.pass.cpp FAIL - # Not analyzed. SKIPPED because this is x86-specific, fatal error C1060: compiler is out of heap space std/algorithms/alg.modifying.operations/alg.transform/ranges.transform.binary.iterator.pass.cpp:0 SKIPPED std/algorithms/alg.modifying.operations/alg.transform/ranges.transform.binary.iterator.pass.cpp:1 SKIPPED From cbaa0deaf061c48354d454d44cebf95c44fd37e1 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Tue, 26 Dec 2023 02:14:02 +0800 Subject: [PATCH 2/2] Cite DevCom-10548086 --- stl/inc/memory | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/stl/inc/memory b/stl/inc/memory index 8417fbc8b5f..8b528752403 100644 --- a/stl/inc/memory +++ b/stl/inc/memory @@ -1469,15 +1469,26 @@ struct _SP_convertible : is_convertible<_Yty*, _Ty*>::type {}; template struct _SP_convertible<_Yty, _Uty[], _Void> : false_type {}; +#if defined(__clang__) || defined(__EDG__) // TRANSITION, DevCom-10548086 +template +struct _SP_convertible<_Yty, _Uty[], void_t<_Yty (*)[]>> : is_convertible<_Yty (*)[], _Uty (*)[]>::type {}; +#else // ^^^ no workaround / workaround vvv template struct _SP_convertible<_Yty, _Uty[], void_t(nullptr))>> : is_convertible<_Yty (*)[], _Uty (*)[]>::type {}; +#endif // ^^^ workaround ^^^ template struct _SP_convertible<_Yty, _Uty[_Ext], _Void> : false_type {}; +#if defined(__clang__) || defined(__EDG__) // TRANSITION, DevCom-10548086 +template +struct _SP_convertible<_Yty, _Uty[_Ext], void_t<_Yty (*)[_Ext]>> + : is_convertible<_Yty (*)[_Ext], _Uty (*)[_Ext]>::type {}; +#else // ^^^ no workaround / workaround vvv template struct _SP_convertible<_Yty, _Uty[_Ext], void_t(nullptr))>> : is_convertible<_Yty (*)[_Ext], _Uty (*)[_Ext]>::type {}; +#endif // ^^^ workaround ^^^ template struct _SP_pointer_compatible : is_convertible<_Yty*, _Ty*>::type {