Opened 10 years ago
Closed 10 years ago
#6930 closed Bugs (fixed)
jacobi_elliptic declaration issue
Reported by: | Owned by: | John Maddock | |
---|---|---|---|
Milestone: | To Be Determined | Component: | math |
Version: | Boost 1.49.0 | Severity: | Regression |
Keywords: | Cc: |
Description
I have recently noticed an issue with the Boost Math library:
"../boost/math/special_functions/jacobi_elliptic.hpp", line 141.46: 1540-1187 (S) "template <class T> 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".
As far as I understand from C++03 subclause 8.3.6 [dcl.fct.default] paragraph 4:
For non-template functions, default arguments can be added in later declarations of a function in the same scope.
the code present (preprocessed and grep'd below):
#line 35 "../boost/math/special_functions/math_fwd.hpp"
typename tools::promote_args<T>::type jacobi_elliptic(T k, T theta, T* pcn, T* pdn, const Policy&); typename tools::promote_args<T>::type jacobi_elliptic(T k, T theta, T* pcn, T* pdn);
#line 12 "../boost/math/special_functions/jacobi_elliptic.hpp" inline typename tools::promote_args<T>::type jacobi_elliptic(T k, T theta, T* pcn, T* pdn, const Policy&)
static const char* function = "boost::math::jacobi_elliptic<%1%>(%1%)";
inline typename tools::promote_args<T>::type jacobi_elliptic(T k, T theta, T* pcn = 0, T* pdn = 0)
does not appear to met the requirement of being a non-template function, and indeed has default arguments in a later declaration.
(In [78559]) Move default arguments to forward declaration. Fixes #6930.