From patchwork Thu Jun 9 23:29:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 633437 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rQhNC00q5z9sBm for ; Fri, 10 Jun 2016 09:29:30 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=bJAFgL/A; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=rXib92YRfT5VYDoFx tRxj8gL64Zt94VKoeyeKnqtTIkJD5BkjGjKp92tXdqXJ9krtdYX31cpBOgS5MOf7 uHY7sS6FWQvrf3YCE+4IjUNKZxFR2x++b3aEQobCqUjvfowlwcGpOu5HAqqqjGVd /C00QyBjweh9aKmC6XwBSj9F1E= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=sRlHW6FkPGLrvSCb+CWicPv 6xkI=; b=bJAFgL/A9GTH3GYVyR4E0dQe4G+vSywy3rRwxf/y2Z6Fn/LVprkvjwQ oDwBxoJwBaBw924J1rq6YbQiACtKm/GdViPsgkWfyUzgIiMjhD8LUHflbGjGg6tK MrslRXuHv1fwUxCn20249LlEU3pF4yh0XC31qd1ElLk+wwdZLDWw= Received: (qmail 112866 invoked by alias); 9 Jun 2016 23:29:23 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 112850 invoked by uid 89); 9 Jun 2016 23:29:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: aserp1040.oracle.com Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 09 Jun 2016 23:29:19 +0000 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u59NTGWH003032 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 9 Jun 2016 23:29:17 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u59NTGAu019547 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 9 Jun 2016 23:29:16 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u59NTDug014588; Thu, 9 Jun 2016 23:29:16 GMT Received: from [192.168.1.4] (/79.12.211.42) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 09 Jun 2016 16:29:13 -0700 Subject: Re: [C++ RFC / Patch] Again about PR 70202 To: Jason Merrill References: <5759A0FB.2050703@oracle.com> Cc: "gcc-patches@gcc.gnu.org" From: Paolo Carlini Message-ID: <5759FBC7.5080503@oracle.com> Date: Fri, 10 Jun 2016 01:29:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: X-IsSubscribed: yes Hi, On 09/06/2016 23:38, Jason Merrill wrote: > I would think that when we see a duplicated base we should just drop > the duplicates and continue. > > If the type of b1 is error_mark_node, why isn't the type of b2 also > error_mark_node? Thanks Jason. Normally check_initializer massages the decl basing on the init and so to speak transforms an error_mark_node as TREE_TYPE of the init into an error_mark_node as DECL_INITIAL of a reference. Thus we don't see error_mark_node as TREE_TYPE of b2. Now if I do something as trivial as the attached the testcase passes. Next step, analyze the huge breakage caused by that change, I don't dare running the testsuite ;) Thanks, Paolo. /////////////////// Index: decl.c =================================================================== --- decl.c (revision 237280) +++ decl.c (working copy) @@ -6002,6 +6002,12 @@ check_initializer (tree decl, tree init, int flags tree init_code = NULL; tree core_type; + if (TREE_TYPE (init) == error_mark_node) + { + TREE_TYPE (decl) = error_mark_node; + return NULL_TREE; + } + /* Things that are going to be initialized need to have complete type. */ TREE_TYPE (decl) = type = complete_type (TREE_TYPE (decl));