Skip to content

Commit e0087b5

Browse files
philnik777github-actions[bot]
authored andcommitted
Automerge: [libc++] Fix shared_ptr(Y*) constraint check on GCC (#199429)
GCC has fixed SFINAEing on `delete` since at least GCC 11, so we can properly constrain the constructor.
2 parents 0a063a0 + d06febc commit e0087b5

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

libcxx/include/__memory/shared_ptr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI shared_ptr {
333333
// In C++03 we get errors when trying to do SFINAE with the
334334
// delete operator, so we always pretend that it's deletable.
335335
// The same happens on GCC.
336-
#if !defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_COMPILER_GCC)
336+
#if !defined(_LIBCPP_CXX03_LANG)
337337
,
338338
_If<is_array<_Tp>::value, __is_array_deletable<_Yp*>, __is_deletable<_Yp*> >
339339
#endif

libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/shared_ptr_Y.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ int main(int, char**)
137137

138138
// This should work in C++03 but we get errors when trying to do SFINAE with the delete operator.
139139
// GCC also complains about this.
140-
#if TEST_STD_VER >= 11 && !defined(TEST_COMPILER_GCC)
140+
#if TEST_STD_VER >= 11
141141
{
142142
// LWG2874: Make sure that when T (for std::shared_ptr<T>) is an array type,
143143
// this constructor only participates in overload resolution when

0 commit comments

Comments
 (0)