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.0rc2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.law/] [cvt8.C] - Rev 384
Compare with Previous | Blame | View Log
// { dg-do assemble }
// GROUPS passed conversions
// cvt file
// From: solomon@cs.wisc.edu (Marvin Solomon)
// Message-Id: <9209141509.AA23124@gjetost.cs.wisc.edu>
// Subject: g++ 2.2.2 seems to be forgetting a "const"
// Date: Mon, 14 Sep 92 10:09:58 -0500
extern "C" int printf (const char *, ...);
struct A {
int i;
};
struct B {
int i;
operator const A&() const;
};
B::operator const A&() const {
static A a;
a.i = i;
printf("convert B to A at %x\n", &a);
return a;
}
void f(A &a) { // { dg-error "" } in passing argument
printf("A at %x is %d\n", &a, a.i);
}
int main() {
B b;
b.i = 99;
f(b);// { dg-error "" } .*
}