Skip to content

Commit bbd033d

Browse files
committed
Add test associated with CWG2517
1 parent a3b573c commit bbd033d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

clang/test/CXX/drs/cwg25xx.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,26 @@ enum E2 : S<E2>::I { e };
3232
#endif
3333
} // namespace cwg2516
3434

35+
namespace cwg2517 { // cwg2517: 23
36+
#if __cplusplus >= 202302L
37+
template<typename ArrayType>
38+
concept LargeArray = requires (ArrayType my_array) {
39+
requires my_array.size() > 5;
40+
};
41+
42+
struct Big {
43+
constexpr int size() const { return 100; }
44+
};
45+
46+
struct Small {
47+
constexpr int size() const { return 3; }
48+
};
49+
50+
static_assert(LargeArray<Big>);
51+
static_assert(!LargeArray<Small>);
52+
#endif
53+
} // namespace cwg2517
54+
3555
namespace cwg2518 { // cwg2518: 17
3656

3757
#if __cplusplus >= 201103L

0 commit comments

Comments
 (0)