| 1 |
// RUN: rm -rf %t |
| 2 |
// RUN: %clang_cc1 -x c++ -std=c++20 %s -verify -fmodules -fmodules-cache-path=%t |
| 3 |
// expected-no-diagnostics |
| 4 |
|
| 5 |
#pragma clang module build std |
| 6 |
module std { |
| 7 |
module concepts {} |
| 8 |
module functional {} |
| 9 |
} |
| 10 |
#pragma clang module contents |
| 11 |
#pragma clang module begin std |
| 12 |
|
| 13 |
template <class _Tp> struct common_reference { |
| 14 |
using type = _Tp; |
| 15 |
}; |
| 16 |
|
| 17 |
#pragma clang module end |
| 18 |
#pragma clang module begin std.concepts |
| 19 |
#pragma clang module import std |
| 20 |
|
| 21 |
template <class _Tp> |
| 22 |
concept same_as = __is_same(_Tp, _Tp); |
| 23 |
|
| 24 |
template <class _Tp> |
| 25 |
concept common_reference_with = |
| 26 |
same_as<typename common_reference<_Tp>::type>; |
| 27 |
|
| 28 |
#pragma clang module end |
| 29 |
#pragma clang module begin std.functional |
| 30 |
#pragma clang module import std.concepts |
| 31 |
|
| 32 |
template <class, class _Ip> |
| 33 |
concept sentinel_for = common_reference_with<_Ip>; |
| 34 |
|
| 35 |
constexpr bool ntsf_subsumes_sf(sentinel_for<char *> auto) |
| 36 |
requires true |
| 37 |
{ |
| 38 |
return true; |
| 39 |
} |
| 40 |
bool ntsf_subsumes_sf(sentinel_for<char *> auto); |
| 41 |
static_assert(ntsf_subsumes_sf("")); |
| 42 |
|
| 43 |
#pragma clang module end |
| 44 |
#pragma clang module endbuild |