1 // RUN: %clang_cc1 -std=c++2a -verify %s
3 template<typename T
, typename U
>
4 constexpr static bool is_same_v
= false;
7 constexpr static bool is_same_v
<T
, T
> = true;
10 concept AtLeast2
= sizeof(T
) >= 2;
13 concept AtMost8
= sizeof(T
) <= 8;
17 static int foo() requires AtLeast2
<long> && AtMost8
<long> {
21 static double foo() requires AtLeast2
<char> {
25 static char bar() requires AtLeast2
<char> {
29 static short bar() requires AtLeast2
<long> && AtMost8
<long> {
33 static int bar() requires AtMost8
<long> && AtLeast2
<long> {
37 static char baz() requires AtLeast2
<char> {
41 static short baz() requires AtLeast2
<long> && AtMost8
<long> {
45 static int baz() requires AtMost8
<long> && AtLeast2
<long> {
49 static long baz() requires AtMost8
<long> && AtLeast2
<long> && AtLeast2
<short> {
55 static_assert(is_same_v
<decltype(&S
<int>::foo
), int(*)()>);
56 static_assert(is_same_v
<decltype(&S
<int>::bar
), long(*)()>);
57 // expected-error@-1{{reference to overloaded function could not be resolved; did you mean to call it?}}
58 static_assert(is_same_v
<decltype(&S
<int>::baz
), long(*)()>);