From owner-freebsd-toolchain@freebsd.org Fri Oct 21 15:21:44 2016 Return-Path: Delivered-To: freebsd-toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C43FC1B272 for ; Fri, 21 Oct 2016 15:21:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF3DF16CF for ; Fri, 21 Oct 2016 15:21:43 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::d1be:e456:ed14:df1a] (unknown [IPv6:2001:7b8:3a7:0:d1be:e456:ed14:df1a]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id F132E123F5; Fri, 21 Oct 2016 17:21:40 +0200 (CEST) Content-Type: multipart/signed; boundary="Apple-Mail=_58368D26-2D91-48DC-ABA8-AF07576FA4E4"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: Seeking help with some Clang trouble, compiling ceph From: Dimitry Andric In-Reply-To: <7b6713f1-5671-bdc2-9cb5-97171146bc59@digiware.nl> Date: Fri, 21 Oct 2016 17:21:33 +0200 Cc: FreeBSD Toolchain Message-Id: <8DCCD19E-01EE-4DB4-814E-396D3E450275@FreeBSD.org> References: <7b6713f1-5671-bdc2-9cb5-97171146bc59@digiware.nl> To: Willem Jan Withagen X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 15:21:44 -0000 --Apple-Mail=_58368D26-2D91-48DC-ABA8-AF07576FA4E4 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=windows-1252 On 21 Oct 2016, at 17:07, Willem Jan Withagen wrote: > > On 21-10-2016 15:09, Willem Jan Withagen wrote: >> Hi, >> >> All this Ceph stuff finally used to compile under FreeBSD. >> And all testss completed correctly. >> >> But somewhere in the Ceph-tree there was a lot of template and trait >> code added/replaced. >> Problem is that this compiles under GCC, but Clang throws an error. It >> looks like it cannot select types of automagic conversion. >> >> But this template/trait stuff is too much for me to wrap my head around. >> I'm reading up a lot, but that does not yet get me anywhere. >> >> So I was wondering if anybody with more C++ knowledge would like to >> assist and give some clues as to how to fix this. >> >> The error report is at: >> >> http://cephdev.digiware.nl:8180/jenkins/job/ceph-freebsd/39/consoleFull >> >> And the ceph code can be found at: >> https://github.com/ceph/ceph > > Oke, the preson responsable for the change helped to figure it out, and > it looks like the following diff helps > > diff --git a/src/include/denc.h b/src/include/denc.h > index 59f7686..caa095b 100644 > --- a/src/include/denc.h > +++ b/src/include/denc.h > @@ -722,7 +722,7 @@ struct denc_traits< > template > struct denc_traits< > std::vector, > - typename std::enable_if::supported>::type> { > + typename std::enable_if::supported != 0>::type> { > typedef denc_traits traits; > > enum { supported = true }; > @@ -831,7 +831,7 @@ struct denc_traits< > template > struct denc_traits< > std::set, > - typename std::enable_if::supported>::type> { > + typename std::enable_if::supported != 0>::type> { > typedef denc_traits traits; > > enum { supported = true }; > > And the conclusion is that std::enable_if<> does not always like it when > the value is 'int'. > the definition of supported is: > struct denc_traits { > enum { supported = 0 }; > enum { featured = false }; > enum { bounded = false }; > }; > > and values can range 0..2. > > So is this a GCC liberalization, or is Clang here to picky? It's hard to say without the full source code and a reproducer, but I'd say that enable_if has a bool as the first template argument, so it can't match an int by default. Maybe libstdc++ has a variant with an int as the first template argument, but I haven't looked. -Dimitry --Apple-Mail=_58368D26-2D91-48DC-ABA8-AF07576FA4E4 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.30 iEYEARECAAYFAlgKMoQACgkQsF6jCi4glqPyrQCfT0p4RIyxgizAkmyevxCXXxM3 K58AoNtI56lg3AWLSj7H1p+tCQbqAlqH =p0uR -----END PGP SIGNATURE----- --Apple-Mail=_58368D26-2D91-48DC-ABA8-AF07576FA4E4--