| 1 |
// PR c++/67084 |
| 2 |
// { dg-do compile { target c++17 } } |
| 3 |
// { dg-additional-options "-fconcepts" } |
| 4 |
|
| 5 |
template <class T> |
| 6 |
concept True = true; |
| 7 |
template <class T> |
| 8 |
concept False = false; |
| 9 |
|
| 10 |
template <class T> |
| 11 |
constexpr bool p = false; |
| 12 |
|
| 13 |
template <class T> |
| 14 |
constexpr bool p<T*> = false; |
| 15 |
|
| 16 |
template <class T> |
| 17 |
requires True<T> |
| 18 |
constexpr bool p<T*> = false; |
| 19 |
|
| 20 |
template <class T> |
| 21 |
requires True<T> && (T() == 0) |
| 22 |
constexpr bool p<T*> = true; |
| 23 |
|
| 24 |
template <class T> |
| 25 |
constexpr bool q = false; |
| 26 |
|
| 27 |
template <class T> |
| 28 |
constexpr bool q<T*> = true; |
| 29 |
|
| 30 |
template <class T> |
| 31 |
requires False<T> |
| 32 |
constexpr bool q<T*> = false; |
| 33 |
|
| 34 |
template <class T> |
| 35 |
requires False<T> && (T() != 0) |
| 36 |
constexpr bool q<T*> = false; |
| 37 |
|
| 38 |
static_assert (p<int*>,""); |