repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
concepts
/
intro2.C
blob
928cc2e54878fdb67a337f4373c96db71201ddf8
1
// { dg-do run }
2
// { dg-options "-std=c++17 -fconcepts" }
3
4
#include <cassert>
5
6
template<typename T>
7
concept bool C() { return __is_class(T); }
8
9
template<int N>
10
concept bool P() { return true; }
11
12
C{A} struct S1
13
{
14
P{B} int f1();
15
};
16
17
struct S2 {};
18
19
int main()
20
{
21
S1<S2> s;
22
23
assert(s.f1<10>() == sizeof(S2) + 10);
24
return 0;
25
}
26
27
C{A} P{B} int S1<A>::f1() { return B + sizeof(A); }