summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.benjamin/16077.C
blob: 9338e8755320bdc709932ac0ddd631edd15d2b63 (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
// { dg-do assemble  }
// 981203 bkoz
// g++/16077
// { dg-options "-Wconversion" }

class nicaragua;
struct colombia {
   colombia();
   colombia(const colombia &);
   colombia(const nicaragua &);
   colombia &operator= (const colombia&);
};

struct nicaragua {
public:
   nicaragua();
   nicaragua(const nicaragua&);
   operator colombia();
};

void peace(const colombia&);

void foo(nicaragua& b) {
  peace(b); // { dg-warning "choosing 'nicaragua::operator" "nic" }
  // { dg-warning "conversion" "conv" { target *-*-* } 24 }
  // { dg-message "note" "note" { target *-*-* } 24 }
}