summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/p701.C
blob: 6a52591040ea065d506d7189c336cb6becf188b0 (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
// { dg-do assemble  }
// prms-id: 701

extern "C" 
{
  int printf(const char *, ...);
}


void Munge(int& x) 	// { dg-error "passing argument 1" }
{
   x = 2;
}


class A 
{
 public:
   int i;
   A(int x) : i(x) {}
   void Safe() const;
};

void
A::Safe() const 
{
   Munge(i);	        // { dg-error "invalid initialization" }
}

int main()
{
   const A a(1);
   a.Safe();
}