Opened 12 years ago

Closed 10 years ago

#4927 closed Bugs (fixed)

Incorrect behavior of method clear() for class program_options::variables_map

Reported by: degtyariov.a@… Owned by: Vladimir Prus
Milestone: Component: program_options
Version: Boost 1.49.0 Severity: Problem
Keywords: Cc:

Description

The method clears only members inherited from the std::map. But what about other members of class variables_map (m_final, m_required)?

It is lead to strange behavior in next case:

1) parse default config file and fill corresponding "config file" variables_map;

2) parse command line (into another variables_map), get name of custom config file;

3) call clear() for "config file" variables_map and parse new file and refill "config file" variables_map again;

4) output all values of the "config file" variables_map and denote which of them are defaulted

Workaround: reassign new instance of variables_map instead call clear().

Change History (5)

comment:1 by Vladimir Prus, 12 years ago

Resolution: fixed
Status: newclosed

(In [67772]) Implement variables_map::clear to clear extra members. Fixes #4927

comment:2 by boost-bugs@…, 10 years ago

Milestone: To Be Determined
Resolution: fixed
Status: closedreopened
Version: Boost 1.45.0Boost 1.49.0

This fix never made it into one of the release versions. Since then, 1.45.0 - 1.49.0 have been released without incorporating SVN rev. 67772.

Current trunk does include the fix.

comment:3 by Vladimir Prus, 10 years ago

It looks like you did not check release branch prior to reopening the issue? The fix is very much present there.

in reply to:  3 comment:4 by anonymous, 10 years ago

Replying to vladimir_prus:

It looks like you did not check release branch prior to reopening the issue? The fix is very much present there.

Well yes, but it still did not make it into any release after 1.45.0. Current 1.49.0 also does not contain it. Is it on track for 1.50.0? 17month seems like an awful long time for a fix to appear in a release... :(

comment:5 by Vladimir Prus, 10 years ago

Resolution: fixed
Status: reopenedclosed

It might be long, but given that it's already on release branch (which will become 1.50), it does not seem needed to keep this issue open.

Note: See TracTickets for help on using tickets.