[multiprecision] [detail] [number_base.hpp] Ambiguous partial specialization for canonical_imp
It looks like boost/multiprecision/detail/number_base.hpp header in one
of the later trunk versions
has ambiguous partial specialization problem which Oracle Studio 12.4
C++ compiler detects.
It can be also detected by gcc-4.8.2 as small 35 lines independent test
case below made from this header shows.
gcc -c -std=c++11 t.cc # gcc-4.8.2 compilation
t.cc:17:62: error: ambiguous class template instantiation for 'struct
canonical_imp
It looks like boost/multiprecision/detail/number_base.hpp header in one of the later trunk versions has ambiguous partial specialization problem which Oracle Studio 12.4 C++ compiler detects. It can be also detected by gcc-4.8.2 as small 35 lines independent test case below made from this header shows.
gcc -c -std=c++11 t.cc # gcc-4.8.2 compilation t.cc:17:62: error: ambiguous class template instantiation for 'struct canonical_imp
, (expression_template_option)1u>, cpp_dec_float<50u>, int_<3> >'
Going back to the original code rather than the reduced case, the final
int_<3> implies that the first template argument
(number
On 12/28/14 04:09, John Maddock wrote:
Going back to the original code rather than the reduced case, the final int_<3> implies that the first template argument (number
in this case) is convertible to const char* - and that should definitely *not* be the case. To put it another way, the error message could be a lot better (maybe I'll add a static assert for this special case), but the ambiguity is justified because: is_convertible
>, const char*>::value should never be true, and if it is, the code genuinely doesn't know what to do. So is there a compiler bug effecting is_convertible? Do the type_traits tests pass?
Thank you John,
You got it right, and indeed there is compiler bug for
libs/type_traits/test/is_convertible_test.cpp
As I may see from type_traits logfile that test got 3 separate run-time
miscompares:
is_convertible_test.cpp:113: The expression:
"(::boost::is_convertible
participants (2)
-
John Maddock
-
Sergey Sprogis