2 // RUN: %clang_cc1 -x c++ -std=c++20 %s -verify -fmodules -fmodules-cache-path=%t
3 // expected-no-diagnostics
5 #pragma clang module build std
7 module concepts
[system
] {
8 module assignable
[system
] {
12 module functional
[system
] {
17 module type_traits
[system
] {
22 #pragma clang module contents
23 #pragma clang module begin std.type_traits
25 template<class _Tp
, class _Up
>
26 concept same_as
= __is_same(_Tp
, _Up
);
29 struct common_reference
;
31 template <class _Tp
, class _Up
> struct common_reference
<_Tp
, _Up
>
36 #pragma clang module end // type_traits
38 #pragma clang module begin std.concepts.assignable
39 #pragma clang module import std.type_traits
41 template<class _Tp
, class _Up
>
42 concept common_reference_with
=
43 same_as
<typename common_reference
<_Tp
, _Up
>::type
, typename common_reference
<_Up
, _Tp
>::type
>;
46 template<class _Lhs
, class _Rhs
>
47 concept assignable_from
=
48 common_reference_with
<const __remove_reference_t(_Lhs
)&, const __remove_reference_t(_Rhs
)&> ;
50 #pragma clang module end // std.concepts.assignable
52 #pragma clang module begin std.functional
53 #pragma clang module import std.concepts.assignable
55 template<class _Sp
, class _Ip
>
56 concept sentinel_for
= assignable_from
<_Ip
&, _Ip
>;
57 template <class _Sp
, class _Ip
>
58 concept nothrow_sentinel_for
= sentinel_for
<_Sp
, _Ip
>;
60 #pragma clang module end // std::functional
61 #pragma clang module endbuild // contents
64 #pragma clang module import std.functional
65 constexpr bool ntsf_subsumes_sf(std::nothrow_sentinel_for
<char*> auto) requires
true {
68 constexpr bool ntsf_subsumes_sf(std::sentinel_for
<char*> auto);
69 static_assert(ntsf_subsumes_sf("foo"));