aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/p786.C
blob: 258c36511dee039cd20754a34c33ddba5641abfd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// prms-id: 786

extern "C" void printf (char *, ...);
extern "C" void exit(int);
class C
   {
   int a;
public:
   C() {a = 1;}
   };

void func(const C& a, C& b)
{
   printf ("in const func\n");
   exit(1);
}

void func(C& a, C& b)
{
   printf ("in non-const func\n");
}

void testit(const C& a, C& b)
{
   func(a,b);
}

main()
{
   C a;
   C b;

   func(a,b);
   return 0;
}