From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 67066 invoked by alias); 23 Oct 2016 13:54:29 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 67039 invoked by uid 89); 23 Oct 2016 13:54:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: =?ISO-8859-1?Q?No, score=-1.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=Song, Fran=c3=a7ois, fran=c3=a7ois, H*r:rev.sfr.net?= X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-wm0-f68.google.com Received: from mail-wm0-f68.google.com (HELO mail-wm0-f68.google.com) (74.125.82.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 23 Oct 2016 13:54:27 +0000 Received: by mail-wm0-f68.google.com with SMTP id d199so5906670wmd.1; Sun, 23 Oct 2016 06:54:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=hTYare0MoX2Jfy21N4yiUWAZ1NaQHLOwkQbSatHw5qg=; b=CEOlPOhMJi2DYJEdhEos6oeXGUPiO/1Ruh+S+9eZGvbxjqfBdNRAX1z0Li0nkhyzB4 WIsyXIExcaQPeaMsjLkp7OY4mDeIwVV93+kTMnoddYmnQyXRaZpiEbd/FpT4OitbXhAW siqAqAtRIvLNPNqBqML3qrMIA+YawQ7B+F7kAAXV5iwFIS+aNszcc0SN2dwh5suQtOZA rxPttROXhwepPdvg0r9lWZ9iMwe1DNj7oVdRAEL3LZLUgJp4DY70nnV2S+8Ig8kqcDYV nBc3ythM0KnfbVGDQgz4wes2O+rdksLHND3gr5h7OOtA+W7ZF9INPEcwp8hgRNUJP/me JtKA== X-Gm-Message-State: AA6/9Rl8kglmvi4jEPnXJuMQz3/jsuExSWrY49IJsNWUQs62ixQqHs65I59iapZK37v0Qg== X-Received: by 10.28.174.209 with SMTP id x200mr11518416wme.55.1477230865423; Sun, 23 Oct 2016 06:54:25 -0700 (PDT) Received: from [192.168.1.75] (198.155.119.80.rev.sfr.net. [80.119.155.198]) by smtp.googlemail.com with ESMTPSA id kq7sm13951618wjb.0.2016.10.23.06.54.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Oct 2016 06:54:24 -0700 (PDT) Subject: Re: [PATCH] 77864 Fix noexcept conditions for map/set default constructors To: Tim Song References: <20161005115617.GA5501@redhat.com> <20161005121309.GM29482@redhat.com> <4d30deb3-8720-2aa6-d0f2-94f6fca44825@gmail.com> <20161006213408.GU29482@redhat.com> <60454696-88fc-d7c0-12f5-b0f7e960dba8@gmail.com> <20161009151451.GB25380@redhat.com> <3daba99f-0630-2daf-6975-d93cc4d0cd7b@gmail.com> <7363dc77-9f64-f2f7-35ea-163f5486f66f@gmail.com> Cc: Jonathan Wakely , libstdc++@gcc.gnu.org, gcc-patches From: =?UTF-8?Q?Fran=c3=a7ois_Dumont?= Message-ID: <68d9479e-208f-caea-c443-2f3bf1d40e4f@gmail.com> Date: Sun, 23 Oct 2016 13:54:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <7363dc77-9f64-f2f7-35ea-163f5486f66f@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-SW-Source: 2016-10/txt/msg01849.txt.bz2 Hi I have run all tests with success. Even if it doesn't get rid of _GLIBCXX_NOEXCEPT_IF it still limits it to one place. So is it ok to commit ? François On 12/10/2016 22:36, François Dumont wrote: > On 10/10/2016 23:01, Tim Song wrote: >> Trying again...with a few edits. >> >>> On Mon, Oct 10, 2016 at 3:24 PM, François Dumont >>> wrote: >>> >>> @@ -602,24 +612,32 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >>> struct _Rb_tree_impl : public _Node_allocator >>> { >>> _Key_compare _M_key_compare; >>> - _Rb_tree_node_base _M_header; >>> + _Rb_header_node _M_header; >>> +#if __cplusplus < 201103L >>> size_type _M_node_count; // Keeps track of size of tree. >>> +#else >>> + size_type _M_node_count = 0; // Keeps track of size of tree. >>> +#endif >>> >>> +#if __cplusplus < 201103L >>> _Rb_tree_impl() >>> - : _Node_allocator(), _M_key_compare(), _M_header(), >>> - _M_node_count(0) >>> - { _M_initialize(); } >>> + : _M_node_count(0) >>> + { } >>> +#else >>> + _Rb_tree_impl() = default; >>> +#endif >> >> The default constructor of the associative containers is required to >> value-initialize the comparator (see their synopses in >> [map/set/multimap/multiset.overview]). > I don't have latest Standard version so can't see the exact word but I > find quite annoying that the Standard doesn't allow this simple > implementation. > > I don't know if unodered containers have same kind of requirements for > equal or hash functors but if so current implementation doesn't do > this value initialization. > > So here is another attempt. This time it simply allows to have > noexcept condition in one place and closer to where operations are > being invoked. > > Ok to commit after tests ? > > François >> >> _Rb_tree_impl() = default; doesn't do that; it default-initializes the >> comparator instead. >> >> Tim >> >