Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#3632 closed Bugs (fixed)

match_results and singular iterator woes with msvc-10.0

Reported by: Eric Niebler Owned by: John Maddock
Milestone: Boost 1.43.0 Component: regex
Version: Boost Development Trunk Severity: Problem
Keywords: regex iterator debugging msvc-10.0 Cc:


Hi John, I just fixed a similar issue in xpressive and thought that it would probably manifest in your lib, too. Sure enough. The msvc-10.0 beta has new iterator debugging that is very strict. The following code causes a crash in match_results::swap:

#include <boost/regex.hpp>

int main()
    using namespace boost;
    regex rx("\\w+");
    smatch what0, what1;
    std::string hello("hello");
    if(regex_match(hello, what0, rx))

The problem is that what1.m_base is a singular iterator at this point. The swap tries to assign from it, which is verboten.

Attachments (0)

Change History (3)

comment:1 Changed 8 years ago by John Maddock

Resolution: fixed
Status: newclosed

Sigh... what's really annoying about this is that VC-10 actually appears to be correct in complaining!

Fixed in Trunk.

Thanks for the heads-up, John.

comment:2 Changed 8 years ago by rwebb <richard.webb@…>

Milestone: Boost 1.41.0Boost 1.43.0
Resolution: fixed
Status: closedreopened
Version: Boost 1.40.0Boost Development Trunk

There still seems to be a problem with this with the release version of VC10 and the current trunk code - the

that.m_base = m_base;

on line 407 of match_results.hpp is crashing in the regex_regress regression test, due to being singular.

comment:3 Changed 8 years ago by John Maddock

Resolution: fixed
Status: reopenedclosed

(In [61430]) Disambiguate between boost::ref and std:ref etc. Suppress some new warnings from VC-10. Fix singular iterator logic (fixes VC-10 failures). Fixes #4114. Fixes #3632

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain John Maddock.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.