]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/g++.old-deja/g++.jason/temporary2.C
call.c (struct conversion_info): Rename 'from_type' to 'from'.
[thirdparty/gcc.git] / gcc / testsuite / g++.old-deja / g++.jason / temporary2.C
CommitLineData
6481daa9 1// { dg-do assemble }
921e5a0e
JL
2class X // Indentation has been done so to see the similarities.
3{
4public:
48ca24b2
JJ
5 X() {} // { dg-message "note" } referenced below
6 X(X& x) {x.i=7;} // { dg-message "note" } Both functions modify the
7 void bar(X& x) {x.i=7;} // { dg-message "note" } reference parameter x.
921e5a0e
JL
8 int i;
9};
10
11X foo() { X x; return x; }
12
44957663 13int main()
921e5a0e 14{
48ca24b2
JJ
15 X x(foo()); // { dg-error "no match" } Compiler doesn't warn about temporary reference.
16 x.bar(foo()); // { dg-error "no match" } The same mistake is warned about in this case.
921e5a0e 17}