re PR libstdc++/64584 (basic_regex::assign breaks *this if it throws regex_error)
authorTim Shen <timshen@google.com>
Mon, 19 Jan 2015 22:56:04 +0000 (22:56 +0000)
committerTim Shen <timshen@gcc.gnu.org>
Mon, 19 Jan 2015 22:56:04 +0000 (22:56 +0000)
commit60c176fb459c7780f9cb711e2427e41dca12a54a
tree2a1f4b55f298c9c15782b158f20da48a36995d76
parentb151091dca19708ce7b51fcdf4fffd4b45a831c5
re PR libstdc++/64584 (basic_regex::assign breaks *this if it throws regex_error)

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.

From-SVN: r219865
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/regex.h
libstdc++-v3/include/bits/regex_compiler.h
libstdc++-v3/include/std/regex
libstdc++-v3/testsuite/28_regex/basic_regex/assign/char/string.cc
libstdc++-v3/testsuite/28_regex/basic_regex/imbue/string.cc [new file with mode: 0644]