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
2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.other
/
overload14.C
blob
2a50b1bf5104e9ed9ee29b70e738bd7bc319780b
1
// { dg-do run }
2
// { dg-options "-Wconversion" }
3
extern "C" void abort();
4
5
struct A {
6
typedef double (&B);
7
typedef const double (&C);
8
9
A() { }
10
11
operator C () const;
12
operator B ();
13
};
14
15
static const double d = 2.0;
16
static double e = 3.0;
17
18
A::operator A::C () const
19
{
20
abort ();
21
return d;
22
}
23
24
A::operator A::B ()
25
{
26
return e;
27
}
28
29
int main ()
30
{
31
(A::C) A ();
32
return 0;
33
}