From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12043 invoked by alias); 7 Jan 2015 12:39:24 -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 12021 invoked by uid 89); 7 Jan 2015 12:39:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients 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; Wed, 07 Jan 2015 12:39:22 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t07CdKVv003961 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 7 Jan 2015 07:39:20 -0500 Received: from localhost (ovpn-112-46.ams2.redhat.com [10.36.112.46]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t07CdJjl008771; Wed, 7 Jan 2015 07:39:20 -0500 Date: Wed, 07 Jan 2015 12:39:00 -0000 From: Jonathan Wakely To: Tim Shen Cc: libstdc++ , gcc-patches Subject: Re: [Patch, libstdc++/64239] Use std::swap instead of swap in regex Message-ID: <20150107123919.GC3360@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-01/txt/msg00312.txt.bz2 On 06/01/15 21:03 -0800, Tim Shen wrote: >Bootstrapped and tested. It could be also patched to 4.9 branch. > >Thanks! > > >-- >Regards, >Tim Shen >commit dfe3a26759893849020a659b14fafe8b27e90dae >Author: timshen >Date: Tue Jan 6 19:30:27 2015 -0800 > > PR libstdc++/64239 > No blank line here in the ChangeLog. > * include/bits/regex.h (match_results<>::swap): Use std::swap > instead of swap. > * include/bits/regex_compiler.tcc (_Compiler<>::_M_quantifier): > Likewise. > >diff --git a/libstdc++-v3/include/bits/regex.h b/libstdc++-v3/include/bits/regex.h >index 9b7ed8c..b520039 100644 >--- a/libstdc++-v3/include/bits/regex.h >+++ b/libstdc++-v3/include/bits/regex.h >@@ -1864,7 +1864,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 > swap(match_results& __that) > { > _Base_type::swap(__that); >- swap(_M_begin, __that._M_begin); >+ std::swap(_M_begin, __that._M_begin); This is swapping iterators, which can be user-defined types, so it should support finding a swap function by ADL, i.e. using std::swap; swap(_M_begin, __that._M_begin); > } > //@} Also, there should be a new test, since apparently we don't have any test that tries to call match_results::swap(match_results&).