diff --git a/AK/Concepts.h b/AK/Concepts.h index f3966a1e84..5b753050d9 100644 --- a/AK/Concepts.h +++ b/AK/Concepts.h @@ -49,7 +49,7 @@ template concept DerivedFrom = IsBaseOf; template -concept AnyString = IsConstructible; +concept AnyString = IsConstructible const&>; template concept HashCompatible = IsHashCompatible, Detail::Decay>; diff --git a/Tests/AK/TestStringUtils.cpp b/Tests/AK/TestStringUtils.cpp index 93b4c45157..90090acf10 100644 --- a/Tests/AK/TestStringUtils.cpp +++ b/Tests/AK/TestStringUtils.cpp @@ -6,9 +6,33 @@ #include +#include +#include +#include +#include #include #include +TEST_CASE(hash_compatible) +{ + static_assert(AK::Concepts::HashCompatible); + static_assert(AK::Concepts::HashCompatible); + static_assert(AK::Concepts::HashCompatible); + static_assert(AK::Concepts::HashCompatible); + static_assert(AK::Concepts::HashCompatible); + static_assert(AK::Concepts::HashCompatible); + + static_assert(AK::Concepts::HashCompatible); + static_assert(AK::Concepts::HashCompatible); + static_assert(AK::Concepts::HashCompatible); + static_assert(AK::Concepts::HashCompatible); + static_assert(AK::Concepts::HashCompatible); + static_assert(AK::Concepts::HashCompatible); + + static_assert(AK::Concepts::HashCompatible); + static_assert(AK::Concepts::HashCompatible); +} + TEST_CASE(matches_null) { EXPECT(AK::StringUtils::matches(StringView(), StringView()));