From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5404 invoked by alias); 27 May 2008 19:00:54 -0000 Received: (qmail 5379 invoked by uid 22791); 27 May 2008 19:00:51 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 27 May 2008 19:00:22 +0000 Received: from spaceape9.eur.corp.google.com (spaceape9.eur.corp.google.com [172.28.16.143]) by smtp-out.google.com with ESMTP id m4RJ0GO0022480 for ; Tue, 27 May 2008 20:00:16 +0100 Received: from localhost (elbrus.corp.google.com [172.18.116.17]) by spaceape9.eur.corp.google.com with ESMTP id m4RJ0Fvm009031 for ; Tue, 27 May 2008 20:00:16 +0100 Received: by localhost (Postfix, from userid 74925) id 3BF153A6952; Tue, 27 May 2008 12:00:15 -0700 (PDT) To: gdb-patches@sourceware.org In-Reply-To: <8ac60eac0805161710y1f6de109wfeb09b2d94167c58@mail.gmail.com> Subject: Re: [RFA] Patch for incorrect handling of references to pointers [pr1147] Message-Id: <20080527190015.3BF153A6952@localhost> Date: Wed, 28 May 2008 06:52:00 -0000 From: ppluzhnikov@google.com (Paul Pluzhnikov) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-05/txt/msg00718.txt.bz2 Ping. http://sourceware.org/ml/gdb-patches/2008-05/msg00289.html Also, just discovered that GMail sends base64 attachments even for plain text :( Here it is again as plain text. -- Paul Pluzhnikov 2008-05-08 Paul Pluzhnikov * gdb/valopts.c (find_overload_match): Handle references to pointers. testsuite/ChangeLog: 2008-05-08 Paul Pluzhnikov * gdb.cp/call-c.exp: Test for incorrect handling of reference to pointer. * gdb.cp/call-c.cc: Likewise. --- gdb/testsuite/gdb.cp/call-c.cc.orig 2008-05-08 14:01:57.000000000 -0700 +++ gdb/testsuite/gdb.cp/call-c.cc 2008-05-08 13:40:09.851165000 -0700 @@ -21,7 +21,18 @@ int func(int x) return x; } +struct Foo { + Foo() : x_(1) { } + int func() const { return x_; } + private: + int x_; +}; + int main() { + Foo f; + Foo *pf = &f; + Foo* &rf = pf; + rf->func(); return func(0); } --- gdb/testsuite/gdb.cp/call-c.exp.orig 2008-05-08 14:01:57.000000000 -0700 +++ gdb/testsuite/gdb.cp/call-c.exp 2008-05-08 13:54:14.497857000 -0700 @@ -44,3 +44,6 @@ gdb_load ${binfile} runto_main gdb_test "print foo(1)" "\\\$$decimal = 1" +send_gdb "next\nnext\nnext\n" +gdb_expect -re "$gdb_prompt $" +gdb_test "print rf->func()" "\\\$$decimal = 1" --- gdb/valops.c.orig 2008-05-08 14:01:57.000000000 -0700 +++ gdb/valops.c 2008-05-08 13:57:14.320875000 -0700 @@ -1919,7 +1919,8 @@ find_overload_match (struct type **arg_t 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_PTR + || (TYPE_CODE (value_type (*objp)) == TYPE_CODE_REF))) { temp = value_addr (temp); }