blob: d68f1842ccaa8084f042bb81e008e44efa3b0167 [file] [log] [blame]
Mark Mitchell6481daa2003-05-01 02:02:59 +00001// { dg-do assemble }
Jeff Law921e5a01997-08-19 01:34:40 -06002// GROUPS passed arg-matching
Jeff Law921e5a01997-08-19 01:34:40 -06003// 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
8struct String { String(const char*); };
9
10struct Ack { Ack(String); };
11
Nathan Froydfeb6efc2010-12-08 21:37:51 +000012struct S { void method(Ack); }; // { dg-message "S::method|no known conversion" } referenced below
Jeff Law921e5a01997-08-19 01:34:40 -060013
14void function(Ack);
15
16int
17foo(S *o)
18{ // Neither call has a usable constructor for conversions of char[5] to Ack.
Jason Merrillf8f12272011-03-16 16:03:56 -040019 function("adsf");// { dg-error "could not convert" }
David Malcolm4911b242018-09-12 18:50:08 +000020 o->method("adsf");// { dg-error "cannot convert" }
Jeff Law921e5a01997-08-19 01:34:40 -060021 return 0;
22}