From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22408 invoked by alias); 13 Oct 2010 15:49:58 -0000 Received: (qmail 22394 invoked by uid 22791); 13 Oct 2010 15:49:57 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 13 Oct 2010 15:49:52 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o9DFnnsc012825 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 13 Oct 2010 11:49:50 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o9DFnnUW013350; Wed, 13 Oct 2010 11:49:49 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o9DFnmgg011840; Wed, 13 Oct 2010 11:49:49 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id A18373791BC; Wed, 13 Oct 2010 09:49:48 -0600 (MDT) From: Tom Tromey To: sami wagiaalla Cc: Eli Zaretskii , gdb-patches@sourceware.org Subject: Re: [patch 2/2] Fix overload resolution of int* vs void* References: <4C7BCD42.9070308@redhat.com> <4CAF6B73.5090800@redhat.com> <8339sgo1jl.fsf@gnu.org> <4CAF889C.1080404@redhat.com> <4CB4BE8D.1000001@redhat.com> <4CB5CD25.7080803@redhat.com> Date: Wed, 13 Oct 2010 15:49:00 -0000 In-Reply-To: <4CB5CD25.7080803@redhat.com> (sami wagiaalla's message of "Wed, 13 Oct 2010 11:15:49 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2010-10/txt/msg00221.txt.bz2 >>>>> "Sami" == sami wagiaalla writes: Sami> I added one. The test attempts to make the conversion and fails as Sami> expected. Thanks for adding the tests, and for the explanations. Sami> Having typed this out, I think POINTER_CONVERSION_BADNESS should be Sami> renamed to BOOL_PTR_CONVERSION_BADNESS and given a rank of 3. And all Sami> other conversions outlawed. I'll do this in and test it another Sami> patch. This patch really only deals with the first clauses of the Sami> nested switch statements. Thanks. Tom> GDB generally ignores access protection. It seems like it ought to here Tom> as well. Sami> Hmm, I am worried that this will make overload resolution more Sami> complicated, and lead to incorrect resolution. Yeah, that makes sense to me. But I still think ignoring it is probably the best thing to do here. Consider if you are stopped in a method or friend function of a derived class. In this case you do have access to the base -- so overload resolution should work. But with this patch, it will not. Sami> I have no objection to Sami> calling the inaccessible base function if the user casts the the type: Casting is only ok if the base is accessible :) Access bits are a real problem. I don't know what to do in the long run. Consider something like "print obj.field". If we strictly follow C++, that can only work when "field" is accessible -- but in a debugger that is basically useless. Maybe we could come up with some heuristic for when it would be acceptable and when it would not be. And maybe overloading should be on the "respect access" list -- but I think for the time being we should still ignore it, until we have a good idea of what we want and the capability to implement it correctly. Aside from this final issue the patch looks ok to me. Tom