From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 128353 invoked by alias); 1 Jul 2015 14:06:14 -0000 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 Received: (qmail 128336 invoked by uid 89); 1 Jul 2015 14:06:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f53.google.com Received: from mail-pa0-f53.google.com (HELO mail-pa0-f53.google.com) (209.85.220.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 01 Jul 2015 14:06:12 +0000 Received: by paceq1 with SMTP id eq1so23694502pac.3 for ; Wed, 01 Jul 2015 07:06:11 -0700 (PDT) X-Received: by 10.70.96.65 with SMTP id dq1mr55894099pdb.79.1435759571128; Wed, 01 Jul 2015 07:06:11 -0700 (PDT) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by mx.google.com with ESMTPSA id ug1sm2452205pbc.39.2015.07.01.07.06.08 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 01 Jul 2015 07:06:10 -0700 (PDT) From: Yao Qi To: Jan Kratochvil Cc: Yao Qi , gdb-patches@sourceware.org, Phil Muldoon Subject: Re: [patchv2] compile: Fix crash on cv-qualified self-reference References: <20150418172843.GA17777@host1.jankratochvil.net> <20150516132555.GB17266@host1.jankratochvil.net> <86lhf0p1hf.fsf@gmail.com> <20150701132406.GA13975@host1.jankratochvil.net> Date: Wed, 01 Jul 2015 14:06:00 -0000 In-Reply-To: <20150701132406.GA13975@host1.jankratochvil.net> (Jan Kratochvil's message of "Wed, 1 Jul 2015 15:24:06 +0200") Message-ID: <86a8vgotv5.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-07/txt/msg00041.txt.bz2 Jan Kratochvil writes: > I can change it that way but when you ask "isn't cleaner" then no, I think > your hack is even a bit more ugly than my ugly hack. > OK, that is sort of personal preference, that is fine to me to leave it as is. > There should be two virtual methods, one pure for 'switch (TYPE_CODE (typ= e))' > and the other one checking TYPE_INSTANCE_FLAG* in superclass overriden on= ly by > TYPE_CODE_STRUCT and TYPE_CODE_UNION (there would be no TYPE_CODE_*, thou= gh). If we change to virtual methods, we don't need "switch" at all. Each type can have its virtual method to handle this separately. --=20 Yao (=E9=BD=90=E5=B0=A7)