* cfgloopmanip.c (duplicate_loop_to_header_edge): Cleanup profile
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.jason / temporary2.C
blobc855f8f4a076ec21380a5440052f5738d90d5e5c
1 // { dg-do assemble  }
2 class X // Indentation has been done so to see the similarities.
4 public:
5   X() {}
6          X(X& x) {x.i=7;} // { dg-message "note" "" { target c++14_down } } Both functions modify the
7   void bar(X& x) {x.i=7;} // { dg-message "note" } reference parameter x.
8   int i;
9 };
11 X foo() { X x; return x; }
13 int main() 
15   X   x(foo()); // { dg-error "rvalue" "" { target c++14_down } } Compiler doesn't warn about temporary reference.
16   x.bar(foo()); // { dg-error "rvalue" } The same mistake is warned about in this case.