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
Dead
[official-gcc.git]
/
gomp-20050608-branch
/
gcc
/
testsuite
/
g++.old-deja
/
g++.pt
/
spec29.C
blob
ff5d433ac97c78568ab1e0bb0c4a08923ee7b90f
1
// { dg-do run }
2
char c;
3
4
struct S {
5
template <typename T>
6
operator T*();
7
8
template <typename T>
9
operator T();
10
};
11
12
template <>
13
S::operator int()
14
{
15
return 2;
16
}
17
18
template <>
19
S::operator char*()
20
{
21
return &c;
22
}
23
24
int main()
25
{
26
S s;
27
int i = s;
28
char* cp = s;
29
30
if (i != 2 || cp != &c)
31
return 1;
32
}