From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25716 invoked by alias); 19 Jan 2015 22:56:55 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 25678 invoked by uid 55); 19 Jan 2015 22:56:51 -0000 From: "timshen at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/64584] basic_regex::assign breaks *this if it throws regex_error Date: Mon, 19 Jan 2015 22:56:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: timshen at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-01/txt/msg01932.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64584 --- Comment #1 from Tim Shen --- Author: timshen Date: Mon Jan 19 22:56:04 2015 New Revision: 219865 URL: https://gcc.gnu.org/viewcvs?rev=219865&root=gcc&view=rev Log: PR libstdc++/64584 PR libstdc++/64585 * include/bits/regex.h (basic_regex<>::basic_regex, basic_regex<>::assign, basic_regex<>::imbue, basic_regex<>::swap, basic_regex<>::mark_count): Drop NFA after imbuing basic_regex; Make assign() transactional against exception. * include/bits/regex_compiler.h (__compile_nfa<>): Add back __compile_nfa SFINAE. * include/std/regex: Adjust include order to avoid __compile_nfa forward declaration. * testsuite/28_regex/basic_regex/assign/char/string.cc: New testcase. * testsuite/28_regex/basic_regex/imbue/string.cc: New testcase. Added: trunk/libstdc++-v3/testsuite/28_regex/basic_regex/imbue/ trunk/libstdc++-v3/testsuite/28_regex/basic_regex/imbue/string.cc Modified: trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/include/bits/regex.h trunk/libstdc++-v3/include/bits/regex_compiler.h trunk/libstdc++-v3/include/std/regex trunk/libstdc++-v3/testsuite/28_regex/basic_regex/assign/char/string.cc