URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Subversion Repositories openrisc_2011-10-31
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.jason/] [temporary2.C] - Rev 154
Compare with Previous | Blame | View Log
// { dg-do assemble }
class X // Indentation has been done so to see the similarities.
{
public:
X() {} // { dg-error "" } referenced below
X(X& x) {x.i=7;} // { dg-error "" } Both functions modify the
void bar(X& x) {x.i=7;} // { dg-error "" } reference parameter x.
int i;
};
X foo() { X x; return x; }
int main()
{
X x(foo()); // { dg-error "" } Compiler doesn't warn about temporary reference.
x.bar(foo()); // { dg-error "" } The same mistake is warned about in this case.
}