OSDN Git Service

b6a0194f314d9c4399377d628ba22734ecb30285
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.law / arg11.C
1 // { dg-do assemble  }
2 // GROUPS passed arg-matching
3 // From: gustavo@cpqd.br (Gustavo Chaves)
4 // Date:     Wed, 25 May 94 09:38:00 EST
5 // Subject:  problem with user defined conversions in initialization
6 // Message-ID: <9405251238.AA19815@moon.cpqd.br>
7
8 struct String { String(const char*); };
9
10 struct Ack { Ack(String); };
11
12 struct S { void method(Ack); }; // { dg-message "candidates" } referenced below
13
14 void function(Ack);
15
16 int
17 foo(S *o)
18 { // Neither call has a usable constructor for conversions of char[5] to Ack.
19   function("adsf");// { dg-error "conversion" } 
20   o->method("adsf");// { dg-error "no matching" } 
21   return 0;
22 }