Boost C++ Libraries: Ticket #5958: Passing an argument of non-POD class type boost::match_results through ellipsis https://svn.boost.org/trac10/ticket/5958 <p> 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. </p> <p> 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." </p> <p> This issue was detected with the IBM compiler XL C/C++ 11.1.0.3 with the following diagnostic: </p> <p> "boost/regex/v4/regex_format.hpp", line 912.67: 1540-2924 (W) Cannot pass an argument of non-POD class type "boost::match_results&lt;std::_Ptrit&lt;char,long,const char *,const char &amp;,char *,char &amp;&gt;,std::allocator&lt;boost::sub_match&lt;std::_Ptrit&lt;char,long,const char *,const char &amp;,char *,char &amp;&gt; &gt; &gt; &gt;" 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&lt;std::_Ptrit&lt;char,long,const char *,const char &amp;,char *,char &amp;&gt;,std::allocator&lt;boost::sub_match&lt;std::_Ptrit&lt;char,long,const char *,const char &amp;,char *,char &amp;&gt; &gt; &gt; &gt;" 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&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; &gt;" 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&lt;std::_Ptrit&lt;char,long,const char *,const char &amp;,char *,char &amp;&gt;,std::allocator&lt;boost::sub_match&lt;std::_Ptrit&lt;char,long,const char *,const char &amp;,char *,char &amp;&gt; &gt; &gt; &gt;" 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&lt;std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt; &gt;" through ellipsis. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5958 Trac 1.4.3 John Maddock Mon, 10 Oct 2011 15:46:09 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5958#comment:1 https://svn.boost.org/trac10/ticket/5958#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/74897" title="Improve sprintf usage. Stop passing UDT's through (...) even in meta ...">[74897]</a>) Improve sprintf usage. Stop passing UDT's through (...) even in meta programs. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5958" title="#5958: Bugs: Passing an argument of non-POD class type boost::match_results through ... (closed: fixed)">#5958</a>. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5835" title="#5835: Bugs: cregex.cpp, fileiter.cpp, posix_api.cpp using unsafe sprintf (closed: wontfix)">#5835</a>. </p> Ticket