[Boost-bugs] [Boost C++ Libraries] #5958: Passing an argument of non-POD class type boost::match_results through ellipsis

Subject: [Boost-bugs] [Boost C++ Libraries] #5958: Passing an argument of non-POD class type boost::match_results through ellipsis
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-09-28 18:14:39


#5958: Passing an argument of non-POD class type boost::match_results through
ellipsis
--------------------------------------------------------------------+-------
 Reporter: "LeJacq, Jean Pierre" <jeanpierre.lejacq@…> | Owner: johnmaddock
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: regex
  Version: Boost 1.47.0 | Severity: Problem
 Keywords: POD |
--------------------------------------------------------------------+-------
 boost::regex_replace() is implemented using the any_type struct that has a
 single constructor that has ellipsis as the argument type. The non-POD
 type boost::match_results is passed to the any_type constructor.

 I believe this violates the standard (section 5.2.2 para 7. In particular,
 "If the argument has a non-POD class type (clause 9), the behavior is
 undefined."

 This issue was detected with the IBM compiler XL C/C++ 11.1.0.3 with the
 following diagnostic:

 "boost/regex/v4/regex_format.hpp", line 912.67: 1540-2924 (W) Cannot pass
 an argument of non-POD class type
 "boost::match_results<std::_Ptrit<char,long,const char *,const char &,char
 *,char &>,std::allocator<boost::sub_match<std::_Ptrit<char,long,const char
 *,const char &,char *,char &> > > >" through ellipsis.
 "boost/regex/v4/regex_format.hpp", line 912.73: 1540-2924 (W) Cannot pass
 an argument of non-POD class type
 "boost::match_results<std::_Ptrit<char,long,const char *,const char &,char
 *,char &>,std::allocator<boost::sub_match<std::_Ptrit<char,long,const char
 *,const char &,char *,char &> > > >" through ellipsis.
 "boost/regex/v4/regex_format.hpp", line 912.76: 1540-2924 (W) Cannot pass
 an argument of non-POD class type
 "boost::re_detail::string_out_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char>
> >" through ellipsis.
 "boost/regex/v4/regex_format.hpp", line 912.84: 1540-2924 (W) Cannot pass
 an argument of non-POD class type
 "boost::match_results<std::_Ptrit<char,long,const char *,const char &,char
 *,char &>,std::allocator<boost::sub_match<std::_Ptrit<char,long,const char
 *,const char &,char *,char &> > > >" through ellipsis.
 "boost/regex/v4/regex_format.hpp", line 912.87: 1540-2924 (W) Cannot pass
 an argument of non-POD class type
 "boost::re_detail::string_out_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char>
> >" through ellipsis.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5958>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC