From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10589 invoked by alias); 14 Apr 2015 06:09:15 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 10559 invoked by uid 89); 14 Apr 2015 06:09:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 14 Apr 2015 06:09:14 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t3E69AwZ000499 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 14 Apr 2015 02:09:10 -0400 Received: from host1.jankratochvil.net (ovpn-116-27.ams2.redhat.com [10.36.116.27]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3E696Lj027740 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 14 Apr 2015 02:09:08 -0400 Date: Tue, 14 Apr 2015 06:09:00 -0000 From: Jan Kratochvil To: gcc@gcc.gnu.org Cc: Phil Muldoon , Tom Tromey , gdb@sourceware.org Subject: Re: [gcc libcc1] build_qualified_type for self-referencing/incomplete types Message-ID: <20150414060905.GA22747@host1.jankratochvil.net> References: <20150410123145.GA18073@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150410123145.GA18073@host1.jankratochvil.net> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00024.txt.bz2 On Fri, 10 Apr 2015 14:31:45 +0200, Jan Kratochvil wrote: > What is the recommended fix? I expect pointer to a declaration / opaque type > which gets completed only when one references the 'p' field later? It looks as it got fixed by: -plugin_build_record_type (cc1_plugin::connection *self) +plugin_build_record_type (cc1_plugin::connection *self, const char *name) { plugin_context *ctx = static_cast (self); - return convert_out (ctx->preserve (make_node (RECORD_TYPE))); + tree node (make_node (RECORD_TYPE)); + tree type_decl (build_decl (input_location, TYPE_DECL, get_identifier (name), + node)); + TYPE_NAME (node) = type_decl; + TYPE_STUB_DECL (node) = type_decl; + C_TYPE_BEING_DEFINED (node) = 1; + return convert_out (ctx->preserve (node)); Jan