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
libstdc++: Add missing constexpr to __atomic_impl::__clear_padding
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.pt
/
friend11.C
blob
0f11ef9a95972f407f9ad2c18d50645a170bf432
1
// { dg-do assemble }
2
template <class T>
3
class C;
4
5
template <class T>
6
struct S
7
{
8
template <class U>
9
void f(U u)
10
{
11
C<U> cu;
12
cu.i = 3; // { dg-error "" } S<double>::f<U> is a friend, but this is
13
// S<int>::f<double>.
14
}
15
};
16
17
18
template <class T>
19
class C
20
{
21
template <class U>
22
friend void S<T>::f(U);
23
24
int i; // { dg-message "" } private
25
};
26
27
28
int main()
29
{
30
S<int> si;
31
si.f(3.0);
32
}