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