mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-05-14 18:06:32 +00:00

Substitute constraints only for declarations with different lexical contexts. This results in avoiding the substitution of constraints during the redeclaration check inside a class (and by product caching the wrong substitution result). Test plan: ninja check-all Differential revision: https://reviews.llvm.org/D150730
34 lines
611 B
C++
34 lines
611 B
C++
// RUN: %clang_cc1 -std=c++20 -x c++ %s -verify -fsyntax-only
|
|
// expected-no-diagnostics
|
|
|
|
template <typename T0>
|
|
concept HasMemberBegin = requires(T0 t) { t.begin(); };
|
|
|
|
struct GetBegin {
|
|
template <HasMemberBegin T1>
|
|
void operator()(T1);
|
|
};
|
|
|
|
GetBegin begin;
|
|
|
|
template <typename T2>
|
|
concept Concept = requires(T2 t) { begin(t); };
|
|
|
|
struct Subrange;
|
|
|
|
template <typename T3>
|
|
struct View {
|
|
Subrange &getSubrange();
|
|
|
|
operator bool()
|
|
requires true;
|
|
|
|
operator bool()
|
|
requires requires { begin(getSubrange()); };
|
|
|
|
void begin();
|
|
};
|
|
|
|
struct Subrange : View<void> {};
|
|
static_assert(Concept<Subrange>);
|