URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [conversion/] [op4.C] - Rev 704
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