From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11338 invoked by alias); 24 Jan 2019 17:35:19 -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 11283 invoked by uid 89); 24 Jan 2019 17:35:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx2.freebsd.org Received: from mx2.freebsd.org (HELO mx2.freebsd.org) (8.8.178.116) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 24 Jan 2019 17:35:14 +0000 Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 4553A9A940; Thu, 24 Jan 2019 17:35:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8797D74B31; Thu, 24 Jan 2019 17:35:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id CCD3D1F4CA; Thu, 24 Jan 2019 17:35:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: [PATCH v3 06/17] Replace delete_longjmp_breakpoint_cleanup with a forward_scope_exit type To: Pedro Alves , "Pavel I. Kryukov" , gdb-patches@sourceware.org Cc: tom@tromey.com, andrew.burgess@embecosm.com References: From: John Baldwin Openpgp: preference=signencrypt Message-ID: Date: Thu, 24 Jan 2019 17:35:00 -0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8797D74B31 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.93)[-0.934,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-IsSubscribed: yes X-SW-Source: 2019-01/txt/msg00541.txt.bz2 On 1/24/19 9:09 AM, Pedro Alves wrote: > On 01/24/2019 11:23 AM, Pavel I. Kryukov wrote: >> The patch causes build errors on XCode: >> >> $ clang --version >> Apple LLVM version 10.0.0 (clang-1000.11.45.5) >> Target: x86_64-apple-darwin17.7.0 >> Thread model: posix >> InstalledDir: /Applications/Xcode10.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin > > Thanks. > > Hmm, I only have clang 5.0.2 handy, and I think it links with > libstdc++ instead of clang's own libc++. Here it builds fine. > I had also made sure the patch builds fine with g++ 4.8. > >> >> >> In file included from breakpoint.c:34: >> In file included from ./inferior.h:54: >> ./common/forward-scope-exit.h:98:7: error: no matching constructor for >> initialization of 'decltype(std::bind(&delete_longjmp_breakpoint, >> std::declval()))' (aka '__bind') >> : m_bind_function (std::bind (function, args...)) >> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> ./common/gdb_optional.h:155:19: note: in instantiation of member >> function 'detail::forward_scope_exit> &delete_longjmp_breakpoint, void (int)>::forward_scope_exit' requested >> here >> new (&m_item) T (std::forward(args)...); >> ^ >> breakpoint.c:11127:18: note: in instantiation of function template >> specialization 'gdb::optional> &delete_longjmp_breakpoint, void (int)> >::emplace' requested >> here >> lj_deleter.emplace (thread); >> ^ >> /Applications/Xcode-10.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/functional:2220:7: >> note: candidate constructor (the implicit copy constructor) not >> viable: no known conversion from '__bind<[...], int &>' to 'const >> __bind<[...], int>' for 1st argument >> class __bind >> ^ > > Hmm, references to the copy ctor. I don't really know why I ended up > with a copy here. We can just pass the arguments directly to the > being-constructed bind. Does this work for you? > > From b1caeb9c5334a59680af7b7717ab620e5a912bcf Mon Sep 17 00:00:00 2001 > From: Pedro Alves > Date: Thu, 24 Jan 2019 16:25:44 +0000 > Subject: [PATCH] No copy ctor > > --- > gdb/common/forward-scope-exit.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gdb/common/forward-scope-exit.h b/gdb/common/forward-scope-exit.h > index 8d639151a4..bffc6e683b 100644 > --- a/gdb/common/forward-scope-exit.h > +++ b/gdb/common/forward-scope-exit.h > @@ -95,7 +95,7 @@ class forward_scope_exit > > public: > explicit forward_scope_exit (Args ...args) > - : m_bind_function (std::bind (function, args...)) > + : m_bind_function (function, args...) > { > /* Nothing. */ > } > I got the same failure on FreeBSD (also uses libc++) and this patch fixed the build for me. -- John Baldwin                                                                            Â