gdb: rank an lvalue argument incompatible for an rvalue parameter
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.cp / rvalue-ref-overload.cc
index e3111d528bd623873d5094f60565ecd9750e21f5..30634a9c36c44d333a228c0d578503ebb5740266 100644 (file)
@@ -62,6 +62,12 @@ f (int &&x)
   return 3;
 }
 
+static int
+g (int &&x)
+{
+  return x;
+}
+
 int
 main ()
 {
@@ -78,6 +84,12 @@ main ()
   int test_const // = 3
     = foo_rr_instance1.overloadConst (arg);
 
+  /* The statement below is illegal: cannot bind rvalue reference of
+     type 'int&&' to lvalue of type 'int'.
+
+     result = g (i); */
+  result = g (5); // this is OK
+
   marker1 (); // marker1-returns-here
   return result;
 }
This page took 0.024412 seconds and 4 git commands to generate.