Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/cpp2a/concepts-pr67225-1.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
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 } |