From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6137 invoked by alias); 3 Jul 2005 14:11:03 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 6107 invoked by uid 48); 3 Jul 2005 14:10:57 -0000 Date: Sun, 03 Jul 2005 14:11:00 -0000 Message-ID: <20050703141057.6104.qmail@sourceware.org> From: "gdr at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050629232130.22238.reichelt@gcc.gnu.org> References: <20050629232130.22238.reichelt@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/22238] [4.0/4.1 regression] '#'obj_type_ref' not supported by dump_expr X-Bugzilla-Reason: CC X-SW-Source: 2005-07/txt/msg00275.txt.bz2 List-Id: ------- Additional Comments From gdr at gcc dot gnu dot org 2005-07-03 14:10 ------- (In reply to comment #3) > Subject: Re: [4.0/4.1 regression] '#'obj_type_ref' not supported by dump_expr > > "pinskia at gcc dot gnu dot org" writes: > > | ------- Additional Comments From pinskia at gcc dot gnu dot org 2005-06-30 02:00 ------- > | Confirmed, caused by the patch which introduced obj_type_ref. This also means we can produce better > | diagnostic. > > indeed. Assign it to me. > > -- Gaby > It's simple to move back to the awfull printing -- just add a case for OBJ_TYPE_REF. However, it is hard to fix this completely without, either (a) having the front-end stop generating low-level three nodes; (b) and/or moving to diagnostic with caret. Adding the following to dump_expr(): if (TREE_CODE (fn) == OBJ_TYPE_REF) { tree obj_type = TREE_TYPE (OBJ_TYPE_REF_OBJECT (fn)); int idx = tree_low_cst (OBJ_TYPE_REF_TOKEN (fn), 1); fn = BINFO_VIRTUALS (TYPE_BINFO (TREE_TYPE (obj_type))); while (idx--) fn = TREE_CHAIN (fn); fn = BV_FN (fn); } yields 22238.C: In member function 'void A::bar()': 22238.C:4: error: could not convert 'A::foo()' to 'bool' (while an improvement, it is still suboptimal). Now, if you slightly change the testcase to struct A { virtual void foo(); }; struct B : virtual A { void bar() { if (foo()) ; } }; then you would get the awful 3.C: In member function 'void B::bar()': 3.C:7: error: could not convert '(((A*)this) + (*(int*)(((B*)this)->B::.A::_vptr.A + -0x000000010)))->A::foo()' to 'bool' -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22238