[flang] Fix crash in HLFIR generation (#118399)
[llvm-project.git] / clang / test / SemaTemplate / concepts-no-early-substitution.cpp
blob9e576f16a263be7c2b4465fbc70234eb731cc1d9
1 // RUN: %clang_cc1 -std=c++20 -x c++ %s -verify -fsyntax-only
2 // expected-no-diagnostics
4 template <typename T0>
5 concept HasMemberBegin = requires(T0 t) { t.begin(); };
7 struct GetBegin {
8 template <HasMemberBegin T1>
9 void operator()(T1);
12 GetBegin begin;
14 template <typename T2>
15 concept Concept = requires(T2 t) { begin(t); };
17 struct Subrange;
19 template <typename T3>
20 struct View {
21 Subrange &getSubrange();
23 operator bool()
24 requires true;
26 operator bool()
27 requires requires { begin(getSubrange()); };
29 void begin();
32 struct Subrange : View<void> {};
33 static_assert(Concept<Subrange>);