diff options
Diffstat (limited to 'clang/test/SemaTemplate/concepts.cpp')
-rw-r--r-- | clang/test/SemaTemplate/concepts.cpp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/concepts.cpp b/clang/test/SemaTemplate/concepts.cpp index 3fbe7c0..a54bc02 100644 --- a/clang/test/SemaTemplate/concepts.cpp +++ b/clang/test/SemaTemplate/concepts.cpp @@ -1416,6 +1416,31 @@ concept IsEntitySpec = } +namespace case8 { + +template <class T> +struct type_identity { + using type = T; +}; + +template <typename Inner> +struct Cat {}; + +template <typename T> +concept CatConcept = requires { + []<class Inner>(type_identity<Cat<Inner>>) {}(type_identity<T>{}); +}; + +template <typename Dummy> +struct Feeder { + template <CatConcept Dummy2> + void feed() noexcept {} +}; + +void main() { Feeder<int>{}.feed<Cat<int>>(); } + +} + } namespace GH162125 { @@ -1489,6 +1514,31 @@ static_assert( requires {{ &f } -> C;} ); // expected-error {{reference to overl } +namespace GH162092 { + +template <typename T> +struct vector; + +template <typename T, typename U> +concept C = __is_same_as(T, U); + +template<class T, auto Cpt> +concept generic_range_value = requires { + Cpt.template operator()<int>(); +}; + + +template<generic_range_value<[]< + C<int> + >() {}> T> +void x() {} + +void foo() { + x<vector<int>>(); +} + +} + namespace GH162770 { enum e {}; template<e> struct s {}; |