2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.mike / explicit2.C
blob989367f83e16705ab11e9dce03e97bed21033c2c
1 // { dg-do assemble  }
3 class string {
4 public:
5   string(const char*) { } 
6   explicit string(int size) { }
7 }; 
9 void foo(string) { }
11 string bar() {
12   foo("hello");         // ok
13   foo(string(2));       // ok
14   foo(2);               // { dg-error "" } no implicit conversion from int to string
15   string x = 2;         // { dg-error "" } no implicit conversion from int to string
16   string y(2);          // ok
17   foo((string)2);       // ok
18   return 2;             // { dg-error "" } no implicit conversion from int to string
21 class A : string {
22 public:
23   A() : string(2) { }   // ok