OSDN Git Service
(root)
/
pf3gnuchains
/
gcc-fork.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Formatting fixes.
[pf3gnuchains/gcc-fork.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.pt
/
ttp28.C
1
// { dg-do run }
2
template<class T> class D
3
{
4
public:
5
int f();
6
};
7
8
template<class T> int D<T>::f()
9
{
10
return sizeof(T);
11
}
12
13
template<template<class> class D,class E> class C
14
{
15
D<E> d;
16
public:
17
int f() { return d.f(); }
18
};
19
20
template<template<class> class D,class E> int f(D<E> &d1)
21
{
22
d1.f();
23
C<D,E> d2;
24
d2.f();
25
return 0;
26
}
27
28
template<> int f<>(D<char> &d1)
29
{
30
d1.f();
31
return 0;
32
}
33
34
int main()
35
{
36
D<int> c1;
37
D<char> c2;
38
f(c1);
39
f(c2);
40
}