OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.mike/] [explicit2.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do assemble  }
2
 
3
class string {
4
public:
5
  string(const char*) { }
6
  explicit string(int size) { }
7
};
8
 
9
void foo(string) { }
10
 
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
19
}
20
 
21
class A : string {
22
public:
23
  A() : string(2) { }   // ok
24
};

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.