File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- #ifndef IRIS_REQUIREMENTS_HPP
1+ #ifndef IRIS_REQUIREMENTS_HPP
22#define IRIS_REQUIREMENTS_HPP
33
44// SPDX-License-Identifier: MIT
@@ -87,9 +87,8 @@ concept Cpp17CopyAssignable = Cpp17MoveAssignable<T> && requires {
8787
8888// https://eel.is/c++draft/utility.requirements#tab:cpp17.destructible
8989template <class T >
90- concept Cpp17Destructible = (!std::is_array_v<T>) && std::is_object_v<T> && requires (T u) {
91- { u.~T () };
92- };
90+ concept Cpp17Destructible = std::is_object_v<T> && !std::is_array_v<T> && std::is_destructible_v<T>;
91+ // MSVC 2026 cannot compile `a.~T()` for pointer-to-class types (needs upstream bugfix)
9392
9493// https://eel.is/c++draft/swappable.requirements#5
9594template <class X >
Original file line number Diff line number Diff line change @@ -323,6 +323,11 @@ TEST_CASE("Cpp17CopyAssignable")
323323 }
324324}
325325
326+ template <class T >
327+ concept Cpp17Destructible_expr = requires (T a) {
328+ a.~T ();
329+ };
330+
326331TEST_CASE (" Cpp17Destructible" )
327332{
328333 STATIC_REQUIRE (iris::req::Cpp17Destructible<int >);
@@ -369,6 +374,13 @@ TEST_CASE("Cpp17Destructible")
369374 STATIC_REQUIRE (!std::destructible<void >);
370375 STATIC_REQUIRE ( std::destructible<int &>);
371376 }
377+ {
378+ // Pointer types *should* be destructible
379+ STATIC_REQUIRE (iris::req::Cpp17Destructible<int *>);
380+
381+ struct Class ;
382+ STATIC_REQUIRE (iris::req::Cpp17Destructible<Class*>);
383+ }
372384}
373385
374386namespace {
You can’t perform that action at this time.
0 commit comments