Closed WardBrian closed 1 month ago
Looks like this static assert was introduced by https://github.com/llvm/llvm-project/pull/81379
@SteveBronder @andrjohns are you able to take a look at this? It will become a blocker for the upcoming release I think!
It appears the issue is specifically with mixing a complex value of our autodiff types with a primitive in pow()
The actual error in details
it comes from here.
template <class _Tp, class _Up, __enable_if_t<is_arithmetic<_Up>::value, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI complex<typename __promote<_Tp, _Up>::type> pow(const complex<_Tp>& __x, const _Up& __y) {
typedef complex<typename __promote<_Tp, _Up>::type> result_type;
return std::pow(result_type(__x), result_type(__y));
}
and the offending code in the tests is calling a complex<var>
and double
auto d2 = pow(cv, d);
which should be calling the stan pow function from here
/**
* Return the first argument raised to the power of the second argument.
*
* @tparam T arithmetic type
* @param x first argument
* @param y second argument
* @return first argument to the power of the second argument
*/
template <typename T, typename = require_arithmetic_t<T>>
inline std::complex<var> pow(const std::complex<var>& x, T y) {
return internal::complex_pow(x, y);
}
We could make ours a more likely candidate by making T
info const T&
, but I think that just kicks the can down the line. I'm going to file an issue with them about this but for now I think your #3109 is the right answer
Hmm, actually maybe we should just make our T
, const T&
since all of their signatures are const T&
. I don't have 19.0.1 locally but that would solve the problem.
For testing I can pull the docker image we use, if there’s something you’d rather me try
Yes I think that's right because the standard has the pow signature using const &
Can you try changing the signature I linked above to be
template <typename T, typename = require_arithmetic_t<T>>
inline std::complex<var> pow(const std::complex<var>& x, const T& y) {
return internal::complex_pow(x, y);
}
@SteveBronder it looks like this model also fails, due to the apply_scalar overload calling pow
instead of stan::math::pow.
```
n file included from pow.hpp:1:
In file included from /home/jenkins/cmdstan/stan/src/stan/model/model_header.hpp:4:
In file included from /home/jenkins/cmdstan/stan/src/stan/model/model_base.hpp:7:
In file included from /home/jenkins/cmdstan/stan/src/stan/io/var_context.hpp:4:
In file included from /usr/local/include/c++/v1/sstream:317:
In file included from /usr/local/include/c++/v1/__ostream/basic_ostream.h:16:
In file included from /usr/local/include/c++/v1/__system_error/error_code.h:18:
In file included from /usr/local/include/c++/v1/__system_error/error_category.h:15:
In file included from /usr/local/include/c++/v1/string:614:
In file included from /usr/local/include/c++/v1/__memory_resource/polymorphic_allocator.h:20:
In file included from /usr/local/include/c++/v1/tuple:268:
In file included from /usr/local/include/c++/v1/compare:174:
In file included from /usr/local/include/c++/v1/cmath:316:
In file included from /usr/local/include/c++/v1/__math/hypot.h:15:
In file included from /usr/local/include/c++/v1/__math/exponential_functions.h:17:
/usr/local/include/c++/v1/__type_traits/promote.h:32:18: error: static assertion failed due to requirement 'is_arithmetic
Unfortunately it doesn't look like adding const &
to all our T
s fixes it
(note: that failure does not mention std::complex)
Oh that's very interesting. Yes in that case I think just adding stan::math::
to pow calls in that test makes sense. We do that for the compiler generated code anyway
Description
LLVM 19.1.0 was released last week: https://discourse.llvm.org/t/llvm-19-1-0-released/81285
Running our test pipeline uncovered some failures: https://jenkins.flatironinstitute.org/blue/organizations/jenkins/Stan%2FBleedingEdgeCompilersMonthly/detail/BleedingEdgeCompilersMonthly/198/pipeline/207
Example
Details
``` In file included from test/unit/math/mix/fun_16_test.cpp:1: In file included from ./test/unit/math/test_ad.hpp:4: In file included from ./stan/math/mix.hpp:4: In file included from ./stan/math/mix/meta.hpp:6: In file included from ./stan/math/fwd/core.hpp:4: In file included from ./stan/math/fwd/core/fvar.hpp:4: In file included from ./stan/math/prim/meta.hpp:72: In file included from ./stan/math/prim/meta/append_return_type.hpp:4: In file included from ./stan/math/prim/fun/Eigen.hpp:22: In file included from lib/eigen_3.4.0/Eigen/Dense:1: In file included from lib/eigen_3.4.0/Eigen/Core:19: In file included from lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679: In file included from /usr/local/include/c++/v1/cmath:316: In file included from /usr/local/include/c++/v1/__math/hypot.h:15: In file included from /usr/local/include/c++/v1/__math/exponential_functions.h:17: /usr/local/include/c++/v1/__type_traits/promote.h:32:18: error: static assertion failed due to requirement 'is_arithmetic>::value'
32 | static_assert((is_arithmetic<_Args>::value && ...));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/v1/complex:1116:47: note: in instantiation of template class 'std::__promote>' requested here
1116 | inline _LIBCPP_HIDE_FROM_ABI complex::type> pow(const _Tp& __x, const complex<_Up>& __y) {
| ^
test/unit/math/mix/fun_16_test.cpp:275:13: note: while substituting deduced template arguments into function template 'pow' [with _Tp = int, _Up = stan::math::var_value, $2 = (no value)]
275 | auto a5 = pow(i, cv);
| ^
In file included from test/unit/math/mix/fun_16_test.cpp:1:
In file included from ./test/unit/math/test_ad.hpp:4:
In file included from ./stan/math/mix.hpp:4:
In file included from ./stan/math/mix/meta.hpp:6:
In file included from ./stan/math/fwd/core.hpp:4:
In file included from ./stan/math/fwd/core/fvar.hpp:4:
In file included from ./stan/math/prim/meta.hpp:72:
In file included from ./stan/math/prim/meta/append_return_type.hpp:4:
In file included from ./stan/math/prim/fun/Eigen.hpp:22:
In file included from lib/eigen_3.4.0/Eigen/Dense:1:
In file included from lib/eigen_3.4.0/Eigen/Core:19:
In file included from lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /usr/local/include/c++/v1/cmath:316:
In file included from /usr/local/include/c++/v1/__math/hypot.h:15:
In file included from /usr/local/include/c++/v1/__math/exponential_functions.h:17:
/usr/local/include/c++/v1/__type_traits/promote.h:32:18: error: static assertion failed due to requirement 'is_arithmetic>::value'
32 | static_assert((is_arithmetic<_Args>::value && ...));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/v1/complex:1116:47: note: in instantiation of template class 'std::__promote>' requested here
1116 | inline _LIBCPP_HIDE_FROM_ABI complex::type> pow(const _Tp& __x, const complex<_Up>& __y) {
| ^
test/unit/math/mix/fun_16_test.cpp:281:13: note: while substituting deduced template arguments into function template 'pow' [with _Tp = double, _Up = stan::math::var_value, $2 = (no value)]
281 | auto b5 = pow(d, cv);
| ^
In file included from test/unit/math/mix/fun_16_test.cpp:1:
In file included from ./test/unit/math/test_ad.hpp:4:
In file included from ./stan/math/mix.hpp:4:
In file included from ./stan/math/mix/meta.hpp:6:
In file included from ./stan/math/fwd/core.hpp:4:
In file included from ./stan/math/fwd/core/fvar.hpp:4:
In file included from ./stan/math/prim/meta.hpp:72:
In file included from ./stan/math/prim/meta/append_return_type.hpp:4:
In file included from ./stan/math/prim/fun/Eigen.hpp:22:
In file included from lib/eigen_3.4.0/Eigen/Dense:1:
In file included from lib/eigen_3.4.0/Eigen/Core:19:
In file included from lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /usr/local/include/c++/v1/cmath:316:
In file included from /usr/local/include/c++/v1/__math/hypot.h:15:
In file included from /usr/local/include/c++/v1/__math/exponential_functions.h:17:
/usr/local/include/c++/v1/__type_traits/promote.h:32:18: error: static assertion failed due to requirement 'is_arithmetic>::value'
32 | static_assert((is_arithmetic<_Args>::value && ...));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/v1/complex:1110:47: note: in instantiation of template class 'std::__promote, int>' requested here
1110 | inline _LIBCPP_HIDE_FROM_ABI complex::type> pow(const complex<_Tp>& __x, const _Up& __y) {
| ^
test/unit/math/mix/fun_16_test.cpp:295:13: note: while substituting deduced template arguments into function template 'pow' [with _Tp = stan::math::var_value, _Up = int, $2 = (no value)]
295 | auto d1 = pow(cv, i);
| ^
In file included from test/unit/math/mix/fun_16_test.cpp:1:
In file included from ./test/unit/math/test_ad.hpp:4:
In file included from ./stan/math/mix.hpp:4:
In file included from ./stan/math/mix/meta.hpp:6:
In file included from ./stan/math/fwd/core.hpp:4:
In file included from ./stan/math/fwd/core/fvar.hpp:4:
In file included from ./stan/math/prim/meta.hpp:72:
In file included from ./stan/math/prim/meta/append_return_type.hpp:4:
In file included from ./stan/math/prim/fun/Eigen.hpp:22:
In file included from lib/eigen_3.4.0/Eigen/Dense:1:
In file included from lib/eigen_3.4.0/Eigen/Core:19:
In file included from lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /usr/local/include/c++/v1/cmath:316:
In file included from /usr/local/include/c++/v1/__math/hypot.h:15:
In file included from /usr/local/include/c++/v1/__math/exponential_functions.h:17:
/usr/local/include/c++/v1/__type_traits/promote.h:32:18: error: static assertion failed due to requirement 'is_arithmetic>::value'
32 | static_assert((is_arithmetic<_Args>::value && ...));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/v1/complex:1110:47: note: in instantiation of template class 'std::__promote, double>' requested here
1110 | inline _LIBCPP_HIDE_FROM_ABI complex::type> pow(const complex<_Tp>& __x, const _Up& __y) {
| ^
test/unit/math/mix/fun_16_test.cpp:296:13: note: while substituting deduced template arguments into function template 'pow' [with _Tp = stan::math::var_value, _Up = double, $2 = (no value)]
296 | auto d2 = pow(cv, d);
| ^
In file included from test/unit/math/mix/fun_16_test.cpp:1:
In file included from ./test/unit/math/test_ad.hpp:4:
In file included from ./stan/math/mix.hpp:4:
In file included from ./stan/math/mix/meta.hpp:6:
In file included from ./stan/math/fwd/core.hpp:4:
In file included from ./stan/math/fwd/core/fvar.hpp:4:
In file included from ./stan/math/prim/meta.hpp:72:
In file included from ./stan/math/prim/meta/append_return_type.hpp:4:
In file included from ./stan/math/prim/fun/Eigen.hpp:22:
In file included from lib/eigen_3.4.0/Eigen/Dense:1:
In file included from lib/eigen_3.4.0/Eigen/Core:19:
In file included from lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /usr/local/include/c++/v1/cmath:316:
In file included from /usr/local/include/c++/v1/__math/hypot.h:15:
In file included from /usr/local/include/c++/v1/__math/exponential_functions.h:17:
/usr/local/include/c++/v1/__type_traits/promote.h:32:18: error: static assertion failed due to requirement 'is_arithmetic>::value'
32 | static_assert((is_arithmetic<_Args>::value && ...));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/v1/complex:1103:47: note: in instantiation of template class 'std::__promote, stan::math::var_value>' requested here
1103 | inline _LIBCPP_HIDE_FROM_ABI complex::type>
| ^
test/unit/math/mix/fun_16_test.cpp:299:13: note: while substituting deduced template arguments into function template 'pow' [with _Tp = stan::math::var_value, _Up = stan::math::var_value]
299 | auto d5 = pow(cv, cv);
| ^
In file included from test/unit/math/mix/fun_16_test.cpp:1:
In file included from ./test/unit/math/test_ad.hpp:4:
In file included from ./stan/math/mix.hpp:4:
In file included from ./stan/math/mix/meta.hpp:6:
In file included from ./stan/math/fwd/core.hpp:4:
In file included from ./stan/math/fwd/core/fvar.hpp:4:
In file included from ./stan/math/prim/meta.hpp:72:
In file included from ./stan/math/prim/meta/append_return_type.hpp:4:
In file included from ./stan/math/prim/fun/Eigen.hpp:22:
In file included from lib/eigen_3.4.0/Eigen/Dense:1:
In file included from lib/eigen_3.4.0/Eigen/Core:19:
In file included from lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /usr/local/include/c++/v1/cmath:316:
In file included from /usr/local/include/c++/v1/__math/hypot.h:15:
In file included from /usr/local/include/c++/v1/__math/exponential_functions.h:17:
/usr/local/include/c++/v1/__type_traits/promote.h:32:18: error: static assertion failed due to requirement 'is_arithmetic>::value'
32 | static_assert((is_arithmetic<_Args>::value && ...));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/v1/complex:1116:47: note: in instantiation of template class 'std::__promote>' requested here
1116 | inline _LIBCPP_HIDE_FROM_ABI complex::type> pow(const _Tp& __x, const complex<_Up>& __y) {
| ^
test/unit/math/mix/fun_16_test.cpp:321:13: note: while substituting deduced template arguments into function template 'pow' [with _Tp = int, _Up = stan::math::fvar, $2 = (no value)]
321 | auto a5 = pow(i, cv);
| ^
In file included from test/unit/math/mix/fun_16_test.cpp:1:
In file included from ./test/unit/math/test_ad.hpp:4:
In file included from ./stan/math/mix.hpp:4:
In file included from ./stan/math/mix/meta.hpp:6:
In file included from ./stan/math/fwd/core.hpp:4:
In file included from ./stan/math/fwd/core/fvar.hpp:4:
In file included from ./stan/math/prim/meta.hpp:72:
In file included from ./stan/math/prim/meta/append_return_type.hpp:4:
In file included from ./stan/math/prim/fun/Eigen.hpp:22:
In file included from lib/eigen_3.4.0/Eigen/Dense:1:
In file included from lib/eigen_3.4.0/Eigen/Core:19:
In file included from lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /usr/local/include/c++/v1/cmath:316:
In file included from /usr/local/include/c++/v1/__math/hypot.h:15:
In file included from /usr/local/include/c++/v1/__math/exponential_functions.h:17:
/usr/local/include/c++/v1/__type_traits/promote.h:32:18: error: static assertion failed due to requirement 'is_arithmetic>::value'
32 | static_assert((is_arithmetic<_Args>::value && ...));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/v1/complex:1116:47: note: in instantiation of template class 'std::__promote>' requested here
1116 | inline _LIBCPP_HIDE_FROM_ABI complex::type> pow(const _Tp& __x, const complex<_Up>& __y) {
| ^
test/unit/math/mix/fun_16_test.cpp:327:13: note: while substituting deduced template arguments into function template 'pow' [with _Tp = double, _Up = stan::math::fvar, $2 = (no value)]
327 | auto b5 = pow(d, cv);
| ^
In file included from test/unit/math/mix/fun_16_test.cpp:1:
In file included from ./test/unit/math/test_ad.hpp:4:
In file included from ./stan/math/mix.hpp:4:
In file included from ./stan/math/mix/meta.hpp:6:
In file included from ./stan/math/fwd/core.hpp:4:
In file included from ./stan/math/fwd/core/fvar.hpp:4:
In file included from ./stan/math/prim/meta.hpp:72:
In file included from ./stan/math/prim/meta/append_return_type.hpp:4:
In file included from ./stan/math/prim/fun/Eigen.hpp:22:
In file included from lib/eigen_3.4.0/Eigen/Dense:1:
In file included from lib/eigen_3.4.0/Eigen/Core:19:
In file included from lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /usr/local/include/c++/v1/cmath:316:
In file included from /usr/local/include/c++/v1/__math/hypot.h:15:
In file included from /usr/local/include/c++/v1/__math/exponential_functions.h:17:
/usr/local/include/c++/v1/__type_traits/promote.h:32:18: error: static assertion failed due to requirement 'is_arithmetic>::value'
32 | static_assert((is_arithmetic<_Args>::value && ...));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/v1/complex:1110:47: note: in instantiation of template class 'std::__promote, int>' requested here
1110 | inline _LIBCPP_HIDE_FROM_ABI complex::type> pow(const complex<_Tp>& __x, const _Up& __y) {
| ^
test/unit/math/mix/fun_16_test.cpp:335:13: note: while substituting deduced template arguments into function template 'pow' [with _Tp = stan::math::fvar, _Up = int, $2 = (no value)]
335 | auto d1 = pow(cv, i);
| ^
In file included from test/unit/math/mix/fun_16_test.cpp:1:
In file included from ./test/unit/math/test_ad.hpp:4:
In file included from ./stan/math/mix.hpp:4:
In file included from ./stan/math/mix/meta.hpp:6:
In file included from ./stan/math/fwd/core.hpp:4:
In file included from ./stan/math/fwd/core/fvar.hpp:4:
In file included from ./stan/math/prim/meta.hpp:72:
In file included from ./stan/math/prim/meta/append_return_type.hpp:4:
In file included from ./stan/math/prim/fun/Eigen.hpp:22:
In file included from lib/eigen_3.4.0/Eigen/Dense:1:
In file included from lib/eigen_3.4.0/Eigen/Core:19:
In file included from lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /usr/local/include/c++/v1/cmath:316:
In file included from /usr/local/include/c++/v1/__math/hypot.h:15:
In file included from /usr/local/include/c++/v1/__math/exponential_functions.h:17:
/usr/local/include/c++/v1/__type_traits/promote.h:32:18: error: static assertion failed due to requirement 'is_arithmetic>::value'
32 | static_assert((is_arithmetic<_Args>::value && ...));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/v1/complex:1110:47: note: in instantiation of template class 'std::__promote, double>' requested here
1110 | inline _LIBCPP_HIDE_FROM_ABI complex::type> pow(const complex<_Tp>& __x, const _Up& __y) {
| ^
test/unit/math/mix/fun_16_test.cpp:336:13: note: while substituting deduced template arguments into function template 'pow' [with _Tp = stan::math::fvar, _Up = double, $2 = (no value)]
336 | auto d2 = pow(cv, d);
| ^
In file included from test/unit/math/mix/fun_16_test.cpp:1:
In file included from ./test/unit/math/test_ad.hpp:4:
In file included from ./stan/math/mix.hpp:4:
In file included from ./stan/math/mix/meta.hpp:6:
In file included from ./stan/math/fwd/core.hpp:4:
In file included from ./stan/math/fwd/core/fvar.hpp:4:
In file included from ./stan/math/prim/meta.hpp:72:
In file included from ./stan/math/prim/meta/append_return_type.hpp:4:
In file included from ./stan/math/prim/fun/Eigen.hpp:22:
In file included from lib/eigen_3.4.0/Eigen/Dense:1:
In file included from lib/eigen_3.4.0/Eigen/Core:19:
In file included from lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /usr/local/include/c++/v1/cmath:316:
In file included from /usr/local/include/c++/v1/__math/hypot.h:15:
In file included from /usr/local/include/c++/v1/__math/exponential_functions.h:17:
/usr/local/include/c++/v1/__type_traits/promote.h:32:18: error: static assertion failed due to requirement 'is_arithmetic>::value'
32 | static_assert((is_arithmetic<_Args>::value && ...));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/v1/complex:1103:47: note: in instantiation of template class 'std::__promote, stan::math::fvar>' requested here
1103 | inline _LIBCPP_HIDE_FROM_ABI complex::type>
| ^
test/unit/math/mix/fun_16_test.cpp:339:13: note: while substituting deduced template arguments into function template 'pow' [with _Tp = stan::math::fvar, _Up = stan::math::fvar]
339 | auto d5 = pow(cv, cv);
| ^
In file included from test/unit/math/mix/fun_16_test.cpp:1:
In file included from ./test/unit/math/test_ad.hpp:4:
In file included from ./stan/math/mix.hpp:4:
In file included from ./stan/math/mix/meta.hpp:6:
In file included from ./stan/math/fwd/core.hpp:4:
In file included from ./stan/math/fwd/core/fvar.hpp:4:
In file included from ./stan/math/prim/meta.hpp:72:
In file included from ./stan/math/prim/meta/append_return_type.hpp:4:
In file included from ./stan/math/prim/fun/Eigen.hpp:22:
In file included from lib/eigen_3.4.0/Eigen/Dense:1:
In file included from lib/eigen_3.4.0/Eigen/Core:19:
In file included from lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /usr/local/include/c++/v1/cmath:316:
In file included from /usr/local/include/c++/v1/__math/hypot.h:15:
In file included from /usr/local/include/c++/v1/__math/exponential_functions.h:17:
/usr/local/include/c++/v1/__type_traits/promote.h:32:18: error: static assertion failed due to requirement 'is_arithmetic>>::value'
32 | static_assert((is_arithmetic<_Args>::value && ...));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/v1/complex:1110:47: note: in instantiation of template class 'std::__promote>, int>' requested here
1110 | inline _LIBCPP_HIDE_FROM_ABI complex::type> pow(const complex<_Tp>& __x, const _Up& __y) {
| ^
test/unit/math/mix/fun_16_test.cpp:163:13: note: while substituting deduced template arguments into function template 'pow' [with _Tp = stan::math::fvar>, _Up = int, $2 = (no value)]
163 | auto a2 = pow(std::complex(1.0), 1);
| ^
test/unit/math/mix/fun_16_test.cpp:179:3: note: in instantiation of function template specialization 'expect_arith_instantiate>>' requested here
179 | expect_arith_instantiate>>();
| ^
In file included from test/unit/math/mix/fun_16_test.cpp:1:
In file included from ./test/unit/math/test_ad.hpp:4:
In file included from ./stan/math/mix.hpp:4:
In file included from ./stan/math/mix/meta.hpp:6:
In file included from ./stan/math/fwd/core.hpp:4:
In file included from ./stan/math/fwd/core/fvar.hpp:4:
In file included from ./stan/math/prim/meta.hpp:72:
In file included from ./stan/math/prim/meta/append_return_type.hpp:4:
In file included from ./stan/math/prim/fun/Eigen.hpp:22:
In file included from lib/eigen_3.4.0/Eigen/Dense:1:
In file included from lib/eigen_3.4.0/Eigen/Core:19:
In file included from lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /usr/local/include/c++/v1/cmath:316:
In file included from /usr/local/include/c++/v1/__math/hypot.h:15:
In file included from /usr/local/include/c++/v1/__math/exponential_functions.h:17:
/usr/local/include/c++/v1/__type_traits/promote.h:32:18: error: static assertion failed due to requirement 'is_arithmetic>>::value'
32 | static_assert((is_arithmetic<_Args>::value && ...));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/v1/complex:1110:47: note: in instantiation of template class 'std::__promote>, double>' requested here
1110 | inline _LIBCPP_HIDE_FROM_ABI complex::type> pow(const complex<_Tp>& __x, const _Up& __y) {
| ^
test/unit/math/mix/fun_16_test.cpp:164:13: note: while substituting deduced template arguments into function template 'pow' [with _Tp = stan::math::fvar>, _Up = double, $2 = (no value)]
164 | auto b2 = pow(std::complex(1.0), 1.0);
| ^
test/unit/math/mix/fun_16_test.cpp:179:3: note: in instantiation of function template specialization 'expect_arith_instantiate>>' requested here
179 | expect_arith_instantiate>>();
| ^
In file included from test/unit/math/mix/fun_16_test.cpp:1:
In file included from ./test/unit/math/test_ad.hpp:4:
In file included from ./stan/math/mix.hpp:4:
In file included from ./stan/math/mix/meta.hpp:6:
In file included from ./stan/math/fwd/core.hpp:4:
In file included from ./stan/math/fwd/core/fvar.hpp:4:
In file included from ./stan/math/prim/meta.hpp:72:
In file included from ./stan/math/prim/meta/append_return_type.hpp:4:
In file included from ./stan/math/prim/fun/Eigen.hpp:22:
In file included from lib/eigen_3.4.0/Eigen/Dense:1:
In file included from lib/eigen_3.4.0/Eigen/Core:19:
In file included from lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /usr/local/include/c++/v1/cmath:316:
In file included from /usr/local/include/c++/v1/__math/hypot.h:15:
In file included from /usr/local/include/c++/v1/__math/exponential_functions.h:17:
/usr/local/include/c++/v1/__type_traits/promote.h:32:18: error: static assertion failed due to requirement 'is_arithmetic>>::value'
32 | static_assert((is_arithmetic<_Args>::value && ...));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/v1/complex:1116:47: note: in instantiation of template class 'std::__promote>>' requested here
1116 | inline _LIBCPP_HIDE_FROM_ABI complex::type> pow(const _Tp& __x, const complex<_Up>& __y) {
| ^
test/unit/math/mix/fun_16_test.cpp:165:13: note: while substituting deduced template arguments into function template 'pow' [with _Tp = int, _Up = stan::math::fvar>, $2 = (no value)]
165 | auto c2 = pow(1, std::complex(1.0));
| ^
test/unit/math/mix/fun_16_test.cpp:179:3: note: in instantiation of function template specialization 'expect_arith_instantiate>>' requested here
179 | expect_arith_instantiate>>();
| ^
In file included from test/unit/math/mix/fun_16_test.cpp:1:
In file included from ./test/unit/math/test_ad.hpp:4:
In file included from ./stan/math/mix.hpp:4:
In file included from ./stan/math/mix/meta.hpp:6:
In file included from ./stan/math/fwd/core.hpp:4:
In file included from ./stan/math/fwd/core/fvar.hpp:4:
In file included from ./stan/math/prim/meta.hpp:72:
In file included from ./stan/math/prim/meta/append_return_type.hpp:4:
In file included from ./stan/math/prim/fun/Eigen.hpp:22:
In file included from lib/eigen_3.4.0/Eigen/Dense:1:
In file included from lib/eigen_3.4.0/Eigen/Core:19:
In file included from lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /usr/local/include/c++/v1/cmath:316:
In file included from /usr/local/include/c++/v1/__math/hypot.h:15:
In file included from /usr/local/include/c++/v1/__math/exponential_functions.h:17:
/usr/local/include/c++/v1/__type_traits/promote.h:32:18: error: static assertion failed due to requirement 'is_arithmetic>>::value'
32 | static_assert((is_arithmetic<_Args>::value && ...));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/v1/complex:1116:47: note: in instantiation of template class 'std::__promote>>' requested here
1116 | inline _LIBCPP_HIDE_FROM_ABI complex::type> pow(const _Tp& __x, const complex<_Up>& __y) {
| ^
test/unit/math/mix/fun_16_test.cpp:166:13: note: while substituting deduced template arguments into function template 'pow' [with _Tp = double, _Up = stan::math::fvar>, $2 = (no value)]
166 | auto d2 = pow(1.0, std::complex(1.0));
| ^
test/unit/math/mix/fun_16_test.cpp:179:3: note: in instantiation of function template specialization 'expect_arith_instantiate>>' requested here
179 | expect_arith_instantiate>>();
| ^
In file included from test/unit/math/mix/fun_16_test.cpp:1:
In file included from ./test/unit/math/test_ad.hpp:4:
In file included from ./stan/math/mix.hpp:4:
In file included from ./stan/math/mix/meta.hpp:6:
In file included from ./stan/math/fwd/core.hpp:4:
In file included from ./stan/math/fwd/core/fvar.hpp:4:
In file included from ./stan/math/prim/meta.hpp:72:
In file included from ./stan/math/prim/meta/append_return_type.hpp:4:
In file included from ./stan/math/prim/fun/Eigen.hpp:22:
In file included from lib/eigen_3.4.0/Eigen/Dense:1:
In file included from lib/eigen_3.4.0/Eigen/Core:19:
In file included from lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /usr/local/include/c++/v1/cmath:316:
In file included from /usr/local/include/c++/v1/__math/hypot.h:15:
In file included from /usr/local/include/c++/v1/__math/exponential_functions.h:17:
/usr/local/include/c++/v1/__type_traits/promote.h:32:18: error: static assertion failed due to requirement 'is_arithmetic>>::value'
32 | static_assert((is_arithmetic<_Args>::value && ...));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/v1/complex:1103:47: note: in instantiation of template class 'std::__promote>, stan::math::fvar>>' requested here
1103 | inline _LIBCPP_HIDE_FROM_ABI complex::type>
| ^
test/unit/math/mix/fun_16_test.cpp:167:13: note: while substituting deduced template arguments into function template 'pow' [with _Tp = stan::math::fvar>, _Up = stan::math::fvar>]
167 | auto e2 = pow(std::complex(1.0), std::complex(1.0));
| ^
test/unit/math/mix/fun_16_test.cpp:179:3: note: in instantiation of function template specialization 'expect_arith_instantiate>>' requested here
179 | expect_arith_instantiate>>();
| ^
In file included from test/unit/math/mix/fun_16_test.cpp:1:
In file included from ./test/unit/math/test_ad.hpp:4:
In file included from ./stan/math/mix.hpp:4:
In file included from ./stan/math/mix/meta.hpp:6:
In file included from ./stan/math/fwd/core.hpp:4:
In file included from ./stan/math/fwd/core/fvar.hpp:4:
In file included from ./stan/math/prim/meta.hpp:72:
In file included from ./stan/math/prim/meta/append_return_type.hpp:4:
In file included from ./stan/math/prim/fun/Eigen.hpp:22:
In file included from lib/eigen_3.4.0/Eigen/Dense:1:
In file included from lib/eigen_3.4.0/Eigen/Core:19:
In file included from lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /usr/local/include/c++/v1/cmath:316:
In file included from /usr/local/include/c++/v1/__math/hypot.h:15:
In file included from /usr/local/include/c++/v1/__math/exponential_functions.h:17:
/usr/local/include/c++/v1/__type_traits/promote.h:32:18: error: static assertion failed due to requirement 'is_arithmetic>>::value'
32 | static_assert((is_arithmetic<_Args>::value && ...));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/v1/complex:1110:47: note: in instantiation of template class 'std::__promote>, int>' requested here
1110 | inline _LIBCPP_HIDE_FROM_ABI complex::type> pow(const complex<_Tp>& __x, const _Up& __y) {
| ^
test/unit/math/mix/fun_16_test.cpp:163:13: note: while substituting deduced template arguments into function template 'pow' [with _Tp = stan::math::fvar>, _Up = int, $2 = (no value)]
163 | auto a2 = pow(std::complex(1.0), 1);
| ^
test/unit/math/mix/fun_16_test.cpp:180:3: note: in instantiation of function template specialization 'expect_arith_instantiate>>' requested here
180 | expect_arith_instantiate>();
| ^
In file included from test/unit/math/mix/fun_16_test.cpp:1:
In file included from ./test/unit/math/test_ad.hpp:4:
In file included from ./stan/math/mix.hpp:4:
In file included from ./stan/math/mix/meta.hpp:6:
In file included from ./stan/math/fwd/core.hpp:4:
In file included from ./stan/math/fwd/core/fvar.hpp:4:
In file included from ./stan/math/prim/meta.hpp:72:
In file included from ./stan/math/prim/meta/append_return_type.hpp:4:
In file included from ./stan/math/prim/fun/Eigen.hpp:22:
In file included from lib/eigen_3.4.0/Eigen/Dense:1:
In file included from lib/eigen_3.4.0/Eigen/Core:19:
In file included from lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /usr/local/include/c++/v1/cmath:316:
In file included from /usr/local/include/c++/v1/__math/hypot.h:15:
In file included from /usr/local/include/c++/v1/__math/exponential_functions.h:17:
/usr/local/include/c++/v1/__type_traits/promote.h:32:18: error: static assertion failed due to requirement 'is_arithmetic>>::value'
32 | static_assert((is_arithmetic<_Args>::value && ...));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/v1/complex:1110:47: note: in instantiation of template class 'std::__promote>, double>' requested here
1110 | inline _LIBCPP_HIDE_FROM_ABI complex::type> pow(const complex<_Tp>& __x, const _Up& __y) {
| ^
test/unit/math/mix/fun_16_test.cpp:164:13: note: while substituting deduced template arguments into function template 'pow' [with _Tp = stan::math::fvar>, _Up = double, $2 = (no value)]
164 | auto b2 = pow(std::complex(1.0), 1.0);
| ^
test/unit/math/mix/fun_16_test.cpp:180:3: note: in instantiation of function template specialization 'expect_arith_instantiate>>' requested here
180 | expect_arith_instantiate>();
| ^
In file included from test/unit/math/mix/fun_16_test.cpp:1:
In file included from ./test/unit/math/test_ad.hpp:4:
In file included from ./stan/math/mix.hpp:4:
In file included from ./stan/math/mix/meta.hpp:6:
In file included from ./stan/math/fwd/core.hpp:4:
In file included from ./stan/math/fwd/core/fvar.hpp:4:
In file included from ./stan/math/prim/meta.hpp:72:
In file included from ./stan/math/prim/meta/append_return_type.hpp:4:
In file included from ./stan/math/prim/fun/Eigen.hpp:22:
In file included from lib/eigen_3.4.0/Eigen/Dense:1:
In file included from lib/eigen_3.4.0/Eigen/Core:19:
In file included from lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /usr/local/include/c++/v1/cmath:316:
In file included from /usr/local/include/c++/v1/__math/hypot.h:15:
In file included from /usr/local/include/c++/v1/__math/exponential_functions.h:17:
/usr/local/include/c++/v1/__type_traits/promote.h:32:18: error: static assertion failed due to requirement 'is_arithmetic>>::value'
32 | static_assert((is_arithmetic<_Args>::value && ...));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/v1/complex:1116:47: note: in instantiation of template class 'std::__promote>>' requested here
1116 | inline _LIBCPP_HIDE_FROM_ABI complex::type> pow(const _Tp& __x, const complex<_Up>& __y) {
| ^
test/unit/math/mix/fun_16_test.cpp:165:13: note: while substituting deduced template arguments into function template 'pow' [with _Tp = int, _Up = stan::math::fvar>, $2 = (no value)]
165 | auto c2 = pow(1, std::complex(1.0));
| ^
test/unit/math/mix/fun_16_test.cpp:180:3: note: in instantiation of function template specialization 'expect_arith_instantiate>>' requested here
180 | expect_arith_instantiate>();
| ^
In file included from test/unit/math/mix/fun_16_test.cpp:1:
In file included from ./test/unit/math/test_ad.hpp:4:
In file included from ./stan/math/mix.hpp:4:
In file included from ./stan/math/mix/meta.hpp:6:
In file included from ./stan/math/fwd/core.hpp:4:
In file included from ./stan/math/fwd/core/fvar.hpp:4:
In file included from ./stan/math/prim/meta.hpp:72:
In file included from ./stan/math/prim/meta/append_return_type.hpp:4:
In file included from ./stan/math/prim/fun/Eigen.hpp:22:
In file included from lib/eigen_3.4.0/Eigen/Dense:1:
In file included from lib/eigen_3.4.0/Eigen/Core:19:
In file included from lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /usr/local/include/c++/v1/cmath:316:
In file included from /usr/local/include/c++/v1/__math/hypot.h:15:
In file included from /usr/local/include/c++/v1/__math/exponential_functions.h:17:
/usr/local/include/c++/v1/__type_traits/promote.h:32:18: error: static assertion failed due to requirement 'is_arithmetic>>::value'
32 | static_assert((is_arithmetic<_Args>::value && ...));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/c++/v1/complex:1116:47: note: in instantiation of template class 'std::__promote>>' requested here
1116 | inline _LIBCPP_HIDE_FROM_ABI complex::type> pow(const _Tp& __x, const complex<_Up>& __y) {
| ^
test/unit/math/mix/fun_16_test.cpp:166:13: note: while substituting deduced template arguments into function template 'pow' [with _Tp = double, _Up = stan::math::fvar>, $2 = (no value)]
166 | auto d2 = pow(1.0, std::complex(1.0));
| ^
test/unit/math/mix/fun_16_test.cpp:180:3: note: in instantiation of function template specialization 'expect_arith_instantiate>>' requested here
180 | expect_arith_instantiate>();
| ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
```
Expected Output
Compilation to succeed
It smells like #3006 may be related again, it looks like these asserts are in the complex functions
Current Version:
v4.9.0