[CppAD-tickets] [C++ Algorithmic Differentiation] #4: gcc 4.3
complain about ambiguous conversion
C++ Algorithmic Differentiation
coin-trac at coin-or.org
Wed Nov 7 15:09:50 EST 2007
#4: gcc 4.3 complain about ambiguous conversion
------------------------+---------------------------------------------------
Reporter: stefan | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone:
Component: component1 | Version:
Severity: major | Keywords:
------------------------+---------------------------------------------------
Hi,
with gcc 4.3 I get the following error when compiling stable 2.0 or trunk:
{{{
example/bender_quad.cpp: In member function
'CppAD::vector<Type><unnamed>::Fun<Type>::h(const CppAD::vector<Type>&,
const CppAD::vector<double>&) [with Type = CppAD::AD<double>]':
cppad/local/bender_quad.hpp:348: instantiated from 'void
CppAD::BenderQuad(const BAvector&, const BAvector&, Fun, BAvector&,
BAvector&, BAvector&) [with BAvector = CppAD::vector<double>, Fun =
<unnamed>::Fun<CppAD::AD<double> >]'
example/bender_quad.cpp:188: instantiated from here
example/bender_quad.cpp:109: error: ISO C++ says that these are ambiguous,
even though the worst conversion for the first is better than the worst
conversion for the second:
cppad/local/sub.hpp:60: note: candidate 1: CppAD::AD<double>
CppAD::operator-(const CppAD::AD<double>&, const double&)
cppad/local/ad.hpp:120: note: candidate 2: CppAD::AD<Base>
CppAD::AD<Base>::operator-(const CppAD::AD<Base>&) const [with Base =
double]
example/bender_quad.cpp: In member function
'CppAD::vector<Type><unnamed>::Fun<Type>::f(const CppAD::vector<Type>&,
const CppAD::vector<Type>&) [with Type = CppAD::AD<double>]':
cppad/local/bender_quad.hpp:361: instantiated from 'void
CppAD::BenderQuad(const BAvector&, const BAvector&, Fun, BAvector&,
BAvector&, BAvector&) [with BAvector = CppAD::vector<double>, Fun =
<unnamed>::Fun<CppAD::AD<double> >]'
example/bender_quad.cpp:188: instantiated from here
example/bender_quad.cpp:94: error: ISO C++ says that these are ambiguous,
even though the worst conversion for the first is better than the worst
conversion for the second:
cppad/local/sub.hpp:60: note: candidate 1: CppAD::AD<double>
CppAD::operator-(const CppAD::AD<double>&, const double&)
cppad/local/ad.hpp:120: note: candidate 2: CppAD::AD<Base>
CppAD::AD<Base>::operator-(const CppAD::AD<Base>&) const [with Base =
double]
}}}
Stefan
--
Ticket URL: <https://projects.coin-or.org/CppAD/ticket/4>
C++ Algorithmic Differentiation <http://projects.coin-or.org/CppAD>
An algorithmic differentiation library for C++ programs.
More information about the CppAD-tickets
mailing list