From owner-freebsd-current@FreeBSD.ORG Wed Nov 13 07:29:43 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C2626EA; Wed, 13 Nov 2013 07:29:43 +0000 (UTC) Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [IPv6:2001:44b8:8060:ff02:300:1:2:6]) by mx1.freebsd.org (Postfix) with ESMTP id 6251D2A05; Wed, 13 Nov 2013 07:29:42 +0000 (UTC) Received: from ppp118-210-43-157.lns20.adl2.internode.on.net (HELO leader.local) ([118.210.43.157]) by ipmail06.adl2.internode.on.net with ESMTP; 13 Nov 2013 17:59:41 +1030 Message-ID: <52832A63.1000601@ShaneWare.Biz> Date: Wed, 13 Nov 2013 17:59:39 +1030 From: Shane Ambler User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Tijl Coosemans , Steve Kargl Subject: Re: Are clang++ and libc++ compatible? References: <20131112163219.GA2834@troutmask.apl.washington.edu> <77CB2B92-216A-4C80-B033-7E582B5F0DFC@FreeBSD.org> <20131112165422.GA2939@troutmask.apl.washington.edu> <20131112175556.GA3319@troutmask.apl.washington.edu> <20131112201922.GA4330@troutmask.apl.washington.edu> <20131112221946.78602db0@kalimero.tijl.coosemans.org> In-Reply-To: <20131112221946.78602db0@kalimero.tijl.coosemans.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Dimitry Andric , freebsd-current@FreeBSD.org, David Chisnall X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Nov 2013 07:29:43 -0000 On 13/11/2013 07:49, Tijl Coosemans wrote: > On Tue, 12 Nov 2013 12:19:22 -0800 Steve Kargl wrote: >> On Tue, Nov 12, 2013 at 09:55:56AM -0800, Steve Kargl wrote: >>> On Tue, Nov 12, 2013 at 06:37:39PM +0100, Dimitry Andric wrote: >>>> On 12 Nov 2013, at 17:54, Steve Kargl wrote: >>>>> >>>>> struct Entry { >>>>> time_t date; >>>>> Severity severity; >>>>> std::deque messages; >>>>> std::string message; >>>>> bool is_child; >>>>> Entry() : is_child(false) { } >>>>> }; >>>> >>>> I think the problem is that the code tries to use std::deque as a >>>> member of struct Entry, before it is completely defined. This is not >>>> allowed by the standard, although some libraries (e.g. GNU libstdc++) >>>> apparently permit it for some container types. > There's a similar problem with graphics/blender. There's a class > TreeElement which links to its parent TreeElement like this: > > std::map::const_iterator parent; > > Works with libstdc++, fails with libc++. If the standard doesn't > specify this it would still be a very convenient extension. > A possible solution I found looking into this is to wrap the Entry reference in a std::unique_ptr - so changing - std::deque messages; to - std::deque> messages; This turns messages into a pointer so you need to change messages.date into messages->date This got blender compiling past that issue but I haven't got the rest of it compiling to test that it runs.