+2009-02-02 Tom Tromey <tromey@redhat.com>
+
+ PR exp/9059:
+ * valops.c (find_overload_match): Follow typedefs before taking
+ address of object argument.
+
2009-02-01 Doug Evans <dje@google.com>
* target.h (target_waitstatus_to_string): Declare.
+2009-02-02 Tom Tromey <tromey@redhat.com>
+
+ PR exp/9059:
+ * gdb.cp/call-c.exp: Add regression test.
+ * gdb.cp/call-c.cc (FooHandle): New typedef.
+ (main): New variable 'handle'.
+
2009-01-30 Vladimir Prus <vladimir@codesourcery.com>
* lib/mi-support.exp (et_mi_thread_list)
int x_;
};
+typedef Foo *FooHandle;
+
int main()
{
Foo f;
Foo *pf = &f;
Foo* &rf = pf;
+ FooHandle handle = pf;
rf->func(); /* set breakpoint here */
return func(0);
}
gdb_test "print foo(1)" "\\\$$decimal = 1"
gdb_test "continue" ".*breakpoint here.*" "continue to bp"
gdb_test "print rf->func()" "\\\$$decimal = 1"
+
+# Regression test for method call via a typedef.
+gdb_test "print handle->func()" "\\\$$decimal = 1"
if (objp)
{
- if (TYPE_CODE (value_type (temp)) != TYPE_CODE_PTR
- && (TYPE_CODE (value_type (*objp)) == TYPE_CODE_PTR
- || TYPE_CODE (value_type (*objp)) == TYPE_CODE_REF))
+ struct type *temp_type = check_typedef (value_type (temp));
+ struct type *obj_type = check_typedef (value_type (*objp));
+ if (TYPE_CODE (temp_type) != TYPE_CODE_PTR
+ && (TYPE_CODE (obj_type) == TYPE_CODE_PTR
+ || TYPE_CODE (obj_type) == TYPE_CODE_REF))
{
temp = value_addr (temp);
}