Boost C++ Libraries: Ticket #6930: jacobi_elliptic declaration issue https://svn.boost.org/trac10/ticket/6930 <p> I have recently noticed an issue with the Boost Math library: </p> <blockquote> <p> "../boost/math/special_functions/jacobi_elliptic.hpp", line 141.46: 1540-1187 (S) "template &lt;class T&gt; boost::math::jacobi_elliptic(T, T, T *, T *)" must not have default arguments. "../boost/math/special_functions/math_fwd.hpp", line 721.42: 1540-0424 (I) "jacobi_elliptic" is declared on line 721 of "../boost/math/special_functions/math_fwd.hpp". </p> </blockquote> <p> As far as I understand from C++03 subclause 8.3.6 [dcl.fct.default] paragraph 4: </p> <blockquote> <p> For non-template functions, default arguments can be added in later declarations of a function in the same scope. </p> </blockquote> <p> the code present (preprocessed and grep'd below): </p> <p> #line 35 "../boost/math/special_functions/math_fwd.hpp" </p> <blockquote> <p> typename tools::promote_args&lt;T&gt;::type jacobi_elliptic(T k, T theta, T* pcn, T* pdn, const Policy&amp;); typename tools::promote_args&lt;T&gt;::type jacobi_elliptic(T k, T theta, T* pcn, T* pdn); </p> </blockquote> <p> #line 12 "../boost/math/special_functions/jacobi_elliptic.hpp" inline typename tools::promote_args&lt;T&gt;::type jacobi_elliptic(T k, T theta, T* pcn, T* pdn, const Policy&amp;) </p> <blockquote> <p> static const char* function = "boost::math::jacobi_elliptic&lt;%1%&gt;(%1%)"; </p> </blockquote> <p> inline typename tools::promote_args&lt;T&gt;::type jacobi_elliptic(T k, T theta, T* pcn = 0, T* pdn = 0) </p> <p> does not appear to met the requirement of being a non-template function, and indeed has default arguments in a later declaration. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6930 Trac 1.4.3 John Maddock Wed, 23 May 2012 17:18:52 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6930#comment:1 https://svn.boost.org/trac10/ticket/6930#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/78559" title="Move default arguments to forward declaration. Fixes #6930.">[78559]</a>) Move default arguments to forward declaration. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6930" title="#6930: Bugs: jacobi_elliptic declaration issue (closed: fixed)">#6930</a>. </p> Ticket