URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.mike/] [explicit2.C] - Rev 823
Go to most recent revision | Compare with Previous | Blame | View Log
// { dg-do assemble }
class string {
public:
string(const char*) { }
explicit string(int size) { }
};
void foo(string) { }
string bar() {
foo("hello"); // ok
foo(string(2)); // ok
foo(2); // { dg-error "" } no implicit conversion from int to string
string x = 2; // { dg-error "" } no implicit conversion from int to string
string y(2); // ok
foo((string)2); // ok
return 2; // { dg-error "" } no implicit conversion from int to string
}
class A : string {
public:
A() : string(2) { } // ok
};
Go to most recent revision | Compare with Previous | Blame | View Log