summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/p786.C
blob: ebe89c6ab78e4fa62babf19fffba4262f80539fd (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
36
// { dg-do run  }
// prms-id: 786

extern "C" int printf (const 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);
}

int main()
{
   C a;
   C b;

   func(a,b);
   return 0;
}