Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/cpp2a/concepts-pmf1.C @ 152:2b5abeee2509
update gcc11
author | anatofuz |
---|---|
date | Mon, 25 May 2020 07:50:57 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
145:1830386684a0 | 152:2b5abeee2509 |
---|---|
1 // Make sure that the requirement fails because a .* expression of function | |
2 // type can only be used in a call. | |
3 | |
4 // { dg-do compile { target concepts } } | |
5 | |
6 template<class D, class T> | |
7 constexpr decltype(auto) invoke(D (T::*pmd), T&& t) | |
8 noexcept(noexcept(t.*pmd)) | |
9 requires requires { t.*pmd; } | |
10 { return t.*pmd; } | |
11 | |
12 char invoke(...); | |
13 | |
14 struct A | |
15 { | |
16 int f(); | |
17 }; | |
18 | |
19 int main() | |
20 { | |
21 static_assert(sizeof(invoke (&A::f, A())) == 1); | |
22 } |