From patchwork Wed Jan 7 05:03:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Shen X-Patchwork-Id: 425932 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1075414007F for ; Wed, 7 Jan 2015 16:04:03 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; q= dns; s=default; b=ku/v05fmg4xoJtNGA5Beblw5+U74MvqwNjBO8LrELVieYR AdZcrj1vCe8HA9dQ6hNiiM6jLD9wDovquHvQtIptVRPE54qtkvJvRMWphwfZy8C1 ZhYUOY66ItwmLxStv/xMn9mv+FWVZfQz2iueb5sXZAKmCQBMwWXAwmN4jutis= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; s= default; bh=GtPZX08nlds+klKD7TraiAt2bk8=; b=C++RV1M82nB5rGRYn6o8 soTJ1CVOZ48ALkLSZTK1QbjGdTxyh3uX83o5onv+5/glkOSkqSavZHcpReAJcPG5 DTOAC+rX6VVG0XVf4tyR0WZxHw+wr3IT8h7V6E0jNk8qCLpLKJzVPuOXKZhnUUQ7 pJgopV/5xfFz+oIcbhv1D/U= Received: (qmail 13129 invoked by alias); 7 Jan 2015 05:03:55 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 13109 invoked by uid 89); 7 Jan 2015 05:03:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail-qa0-f44.google.com Received: from mail-qa0-f44.google.com (HELO mail-qa0-f44.google.com) (209.85.216.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 07 Jan 2015 05:03:51 +0000 Received: by mail-qa0-f44.google.com with SMTP id bm13so1402670qab.3 for ; Tue, 06 Jan 2015 21:03:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=vgTIut5HMEy9Q5VrsEX/KLPsGBfwLJynfVZ5owhc91k=; b=KDFrzE835Ss6q0XwbnrAPGQWERKO6Sif24LXO4VOeOUJgHyBkYin6KMkX85qkqUvXO haMDYwOsJe2Rf0rjyqYXmShaPVDilVmtrasIW57DZyBcCM6iOGLlZGAzskgRx1C1E5yh tdK9Nk+OtDYgsCCJlpoY/LpfrPbrrB2PPyZPJ3k50F5p3IUaOMViwGBnyClIb/927aGo T8xIBLWcQT6xWQSgte6lYTNNzPyWCRyhA3EXivuagvs83SuJSUwishH1c0ggj0+Edn4C oH+P//NrUWcSx11yB4LezWXCpmIxPXs0gmjKagL1uXm5JxWH+x9NJlxZ3LOtgQedV6w1 JpNw== X-Gm-Message-State: ALoCoQlvhVwQM9Xf0/VicxiaWjD/YqTy22xXhAIMog0hniHKbgTKTcOMa/XoHC0Zs/TGZHgUpi9+ MIME-Version: 1.0 X-Received: by 10.224.89.2 with SMTP id c2mr1472850qam.75.1420607029224; Tue, 06 Jan 2015 21:03:49 -0800 (PST) Received: by 10.96.254.231 with HTTP; Tue, 6 Jan 2015 21:03:49 -0800 (PST) Date: Tue, 6 Jan 2015 21:03:49 -0800 Message-ID: Subject: [Patch, libstdc++/64239] Use std::swap instead of swap in regex From: Tim Shen To: "libstdc++" , gcc-patches Bootstrapped and tested. It could be also patched to 4.9 branch. Thanks! 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); } //@} diff --git a/libstdc++-v3/include/bits/regex_compiler.tcc b/libstdc++-v3/include/bits/regex_compiler.tcc index 57bafa3..33d7118 100644 --- a/libstdc++-v3/include/bits/regex_compiler.tcc +++ b/libstdc++-v3/include/bits/regex_compiler.tcc @@ -276,7 +276,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { auto& __tmp = (*_M_nfa)[__stack.top()]; __stack.pop(); - swap(__tmp._M_next, __tmp._M_alt); + std::swap(__tmp._M_next, __tmp._M_alt); } } _M_stack.push(__e);