Boost logo

Boost :

From: Chris Newbold (Chris.Newbold_at_[hidden])
Date: 2008-07-08 15:09:10


While cleaning up GCC -Wshadow warnings in the date_time library, we've found what appears to be a copy-paste error in a date_generator_formatter constructor.

The following constructor...

      //! Constructor that allows for a custom set of phrase elements
      date_generator_formatter(const string_type& first,
                               const string_type& second,
                               const string_type& third,
                               const string_type& fourth,
                               const string_type& fifth,
                               const string_type& last,
                               const string_type& before,
                               const string_type& after,
                               const string_type& of)
      {
        phrase_strings.push_back(string_type(first_string));
        phrase_strings.push_back(string_type(second_string));
        phrase_strings.push_back(string_type(third_string));
        phrase_strings.push_back(string_type(fourth_string));
        phrase_strings.push_back(string_type(fifth_string));
        phrase_strings.push_back(string_type(last_string));
        phrase_strings.push_back(string_type(before_string));
        phrase_strings.push_back(string_type(after_string));
        phrase_strings.push_back(string_type(of_string));
      }

...takes a whole series of arguments, which it summarily ignores as the constructor body is an exact duplicate of that for the default constructor.

Presumably the right fix is to push all of the given arguments into phrase_strings.

-Chris


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk