gdb: rank an lvalue argument incompatible for an rvalue parameter
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.cp / rvalue-ref-overload.exp
index e729209061ff22ad639cc63b0cd985605a5a2722..cac3d4ba5887cabba63375390c6867dc44d15e8d 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1998-2017 Free Software Foundation, Inc.
+# Copyright 1998-2019 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -49,21 +49,24 @@ cp_test_ptype_class "foo_rr_instance1" "" "class" "foo" \
        { method public "~foo();" }
        { method public "int overload1arg(foo_lval_ref);" }
        { method public "int overload1arg(foo_rval_ref);" }
+       { method public "int overloadConst(const foo &);" }
+       { method public "int overloadConst(const foo &&);" }
     }
 
-gdb_test "print foo_rr_instance1.overload1arg(arg)" \
-    "\\$\[0-9\]+ = 1" \
-    "print call overloaded func foo & arg"
+gdb_test "print foo_rr_instance1.overload1arg(arg)" "1"
 
-gdb_test "print foo_rr_instance1.overload1arg(static_cast<foo&&>(arg))" \
-    "\\$\[0-9\]+ = 2" \
-    "print call overloaded func foo && arg"
+gdb_test "print foo_rr_instance1.overload1arg(static_cast<foo&&>(arg))" "2"
+
+gdb_test "print foo_rr_instance1.overloadConst(arg)" "3"
 
 # Test lvalue vs rvalue function overloads
-setup_kfail "c++/15372" "*-*-*"
-gdb_test "print f (i)" "= 1" "lvalue reference overload"
+gdb_test "print f (i)" "1" "lvalue reference overload"
 
-gdb_test "print f (ci)" "2" "lvalue reference to const overload"
+gdb_test "print f (ci)" "2" "lvalue reference to const overload"
 
 setup_kfail "c++/15372" "*-*-*"
-gdb_test "print f (3)" "= 3" "rvalue reference overload"
+gdb_test "print f (3)" "3" "rvalue reference overload"
+
+gdb_test "print g (i)" \
+    "Cannot resolve function g to any overloaded instance" \
+    "passing lvalue arg to rvalue parameter"
This page took 0.027434 seconds and 4 git commands to generate.