| 1 |
// PR c++/67225 |
| 2 |
// { dg-do compile { target c++20 } } |
| 3 |
// { dg-additional-options "-fconcepts" } |
| 4 |
|
| 5 |
template <class T, class U> |
| 6 |
concept Same = true; |
| 7 |
|
| 8 |
template <class T> struct WrapT {T t;}; |
| 9 |
|
| 10 |
template <class T> |
| 11 |
concept Destructible = |
| 12 |
requires(T t, const T ct, WrapT<T>& wt) // { dg-message "in requirements" } |
| 13 |
{ |
| 14 |
{wt.~WrapT()} noexcept; |
| 15 |
// {&t} -> Same<T*>; // #1 |
| 16 |
//{&t} -> T*; // #2 |
| 17 |
}; |
| 18 |
|
| 19 |
template <Destructible T> |
| 20 |
void f() {} |
| 21 |
|
| 22 |
struct Y {private: ~Y();}; |
| 23 |
|
| 24 |
int main() |
| 25 |
{ |
| 26 |
f<Y>(); // { dg-error "" } |
| 27 |
} |