aboutsummaryrefslogtreecommitdiff
path: root/clang/test/SemaTemplate/concepts.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaTemplate/concepts.cpp')
-rw-r--r--clang/test/SemaTemplate/concepts.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/concepts.cpp b/clang/test/SemaTemplate/concepts.cpp
index 768af09..3fbe7c0 100644
--- a/clang/test/SemaTemplate/concepts.cpp
+++ b/clang/test/SemaTemplate/concepts.cpp
@@ -1404,6 +1404,18 @@ static_assert(!std::is_constructible_v<span<4>, array<int, 3>>);
}
+namespace case7 {
+
+template <class _Tp, class _Up>
+concept __same_as_impl = __is_same(_Tp, _Up);
+template <class _Tp, class _Up>
+concept same_as = __same_as_impl<_Tp, _Up>;
+template <typename>
+concept IsEntitySpec =
+ requires { requires same_as<void, void>; };
+
+}
+
}
namespace GH162125 {
@@ -1476,3 +1488,20 @@ static_assert( requires {{ &f } -> C;} ); // expected-error {{reference to overl
// expected-error@-1 {{static assertion failed due to requirement 'requires { { &f() } -> C; }'}}
}
+
+namespace GH162770 {
+ enum e {};
+ template<e> struct s {};
+
+ template<typename> struct specialized;
+ template<e x> struct specialized<s<x>> {
+ static auto make(auto) -> s<x>;
+ };
+
+ template<e x> struct check {
+ static constexpr auto m = requires { specialized<s<x>>::make(0); };
+ };
+
+ template<typename... Ts> auto comma = (..., Ts());
+ auto b = comma<check<e{}>>;
+} // namespace GH162770