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,8 +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 () };
90+ concept Cpp17Destructible = (!std::is_array_v<T>) && std::is_object_v<T> && requires (T a ) {
91+ { a .~T () };
9292};
9393
9494// https://eel.is/c++draft/swappable.requirements#5
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,20 @@ TEST_CASE("Cpp17Destructible")
369374 STATIC_REQUIRE (!std::destructible<void >);
370375 STATIC_REQUIRE ( std::destructible<int &>);
371376 }
377+ {
378+ struct Class ;
379+
380+ {
381+ using T = Class*;
382+ T t;
383+ t.~T ();
384+ }
385+ STATIC_REQUIRE (Cpp17Destructible_expr<Class*>);
386+
387+ // Pointer types *should* be destructible
388+ STATIC_REQUIRE (iris::req::Cpp17Destructible<int *>);
389+ STATIC_REQUIRE (iris::req::Cpp17Destructible<Class*>);
390+ }
372391}
373392
374393namespace {
You can’t perform that action at this time.
0 commit comments