45 lines · cpp
1// RUN: rm -rf %t2// RUN: %clang_cc1 -x c++ -std=c++20 %s -verify -fmodules -fmodules-cache-path=%t3// expected-no-diagnostics4 5#pragma clang module build std6module std {7 module concepts {}8 module functional {}9}10#pragma clang module contents11#pragma clang module begin std12 13template <class _Tp> struct common_reference {14 using type = _Tp;15};16 17#pragma clang module end18#pragma clang module begin std.concepts19#pragma clang module import std20 21template <class _Tp>22concept same_as = __is_same(_Tp, _Tp);23 24template <class _Tp>25concept common_reference_with =26 same_as<typename common_reference<_Tp>::type>;27 28#pragma clang module end29#pragma clang module begin std.functional30#pragma clang module import std.concepts31 32template <class, class _Ip>33concept sentinel_for = common_reference_with<_Ip>;34 35constexpr bool ntsf_subsumes_sf(sentinel_for<char *> auto)36 requires true37{38 return true;39}40bool ntsf_subsumes_sf(sentinel_for<char *> auto);41static_assert(ntsf_subsumes_sf(""));42 43#pragma clang module end44#pragma clang module endbuild45