URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [conversion/] [op4.C] - Rev 316
Go to most recent revision | Compare with Previous | Blame | View Log
/* PR c++/26698 */
/* { dg-do "compile" } */
struct X {
int x;
X (int i = 0) : x (i) {}
operator X& (void) const {
return *(new X);
}
};
void add_one (X & ref) { /* { dg-error "in passing argument" } */
++ ref.x;
}
void foo() {
X const a (2);
add_one(a); /* { dg-error "invalid initialization of reference of type" } */
}
Go to most recent revision | Compare with Previous | Blame | View Log