1 // { dg-do assemble  }
2 // GROUPS passed conversions
3 // cvt file
4 // From: solomon@cs.wisc.edu (Marvin Solomon)
5 // Message-Id: <9209141509.AA23124@gjetost.cs.wisc.edu>
6 // Subject: g++ 2.2.2 seems to be forgetting a "const"
7 // Date: Mon, 14 Sep 92 10:09:58 -0500
8 
9 extern "C" int printf (const char *, ...);
10 
11 struct A {
12         int i;
13 };
14 
15 struct B {
16         int i;
17         operator const A&() const;
18 };
19 
20 B::operator const A&() const {
21         static A a;
22         a.i = i;
23         printf("convert B to A at %x\n", &a);
24         return a;
25 }
26 
f(A & a)27 void f(A &a) { // { dg-message "" } in passing argument
28         printf("A at %x is %d\n", &a, a.i);
29 }
30 
main()31 int main() {
32         B b;
33         b.i = 99;
34         f(b);// { dg-error "" } .*
35 }
36