foo.cc: In function ‘int main()’:
foo.cc:13:29: warning: comparison with string literal results in unspecified behavior [-Waddress]
13 | if(a=="km"&&b=="mm")
| ~^~~~~~
foo.cc:13:29: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
foo.cc:13:38: warning: comparison with string literal results in unspecified behavior [-Waddress]
13 | if(a=="km"&&b=="mm")
| ~^~~~~~
foo.cc:13:38: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
foo.cc:15:34: warning: comparison with string literal results in unspecified behavior [-Waddress]
15 | else if(a=="km"&&b=="m")
| ~^~~~~~
foo.cc:15:34: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
foo.cc:15:43: warning: comparison with string literal results in unspecified behavior [-Waddress]
15 | else if(a=="km"&&b=="m")
| ~^~~~~
foo.cc:15:43: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
foo.cc:17:34: warning: comparison with string literal results in unspecified behavior [-Waddress]
17 | else if(a=="kg"&&b=="g")
| ~^~~~~~
foo.cc:17:34: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
foo.cc:17:43: warning: comparison with string literal results in unspecified behavior [-Waddress]
17 | else if(a=="kg"&&b=="g")
| ~^~~~~
foo.cc:17:43: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
foo.cc:20:29: warning: comparison with string literal results in unspecified behavior [-Waddress]
20 | if(a=="kg"&&b=="mg")
| ~^~~~~~
foo.cc:20:29: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
foo.cc:20:38: warning: comparison with string literal results in unspecified behavior [-Waddress]
20 | if(a=="kg"&&b=="mg")
| ~^~~~~~
foo.cc:20:38: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
foo.cc:24:38: error: no match for ‘operator*’ (operand types are ‘long long int’ and ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’})
24 | long long cnt=1LL*sum*x;
| ~~~~~~~^~
| | |
| | std::string {aka std::__cxx11::basic_string<char>}
| long long int
foo.cc:24:38: note: there are 11 candidates
24 | long long cnt=1LL*sum*x;
| ~~~~~~~^~
In file included from /nix/gcc-15.2.0/include/c++/15.2.0/ccomplex:43,
from stdc++.h:133:
/nix/gcc-15.2.0/include/c++/15.2.0/complex:434:5: note: candidate 1: ‘template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const complex<_Tp>&)’
434 | operator*(const complex<_Tp>& __x, const complex<_Tp>& __y)
| ^~~~~~~~
/nix/gcc-15.2.0/include/c++/15.2.0/complex:434:5: note: template argument deduction/substitution failed:
foo.cc:24:39: note: mismatched types ‘const std::complex<_Tp>’ and ‘long long int’
24 | long long cnt=1LL*sum*x;
| ^
/nix/gcc-15.2.0/include/c++/15.2.0/complex:443:5: note: candidate 2: ‘template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const _Tp&)’
443 | operator*(const complex<_Tp>& __x, const _Tp& __y)
| ^~~~~~~~
/nix/gcc-15.2.0/include/c++/15.2.0/complex:443:5: note: template argument deduction/substitution failed:
foo.cc:24:39: note: mismatched types ‘const std::complex<_Tp>’ and ‘long long int’
24 | long long cnt=1LL*sum*x;
| ^
/nix/gcc-15.2.0/include/c++/15.2.0/complex:452:5: note: candidate 3: ‘template<class _Tp> std::complex<_Tp> std::operator*(const _Tp&, const complex<_Tp>&)’
452 | operator*(const _Tp& __x, const complex<_Tp>& __y)
| ^~~~~~~~
/nix/gcc-15.2.0/include/c++/15.2.0/complex:452:5: note: template argument deduction/substitution failed:
foo.cc:24:39: note: ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} is not derived from ‘const std::complex<_Tp>’
24 | long long cnt=1LL*sum*x;
| ^
In file included from /nix/gcc-15.2.0/include/c++/15.2.0/valarray:607,
from stdc++.h:169:
/nix/gcc-15.2.0/include/c++/15.2.0/bits/valarray_after.h:409:5: note: candidate 4: ‘template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)’
409 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/gcc-15.2.0/include/c++/15.2.0/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed:
foo.cc:24:39: note: mismatched types ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ and ‘long long int’
24 | long long cnt=1LL*sum*x;
| ^
/nix/gcc-15.2.0/include/c++/15.2.0/bits/valarray_after.h:409:5: note: candidate 5: ‘template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)’
409 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/gcc-15.2.0/include/c++/15.2.0/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed:
foo.cc:24:39: note: mismatched types ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ and ‘long long int’
24 | long long cnt=1LL*sum*x;
| ^
/nix/gcc-15.2.0/include/c++/15.2.0/bits/valarray_after.h:409:5: note: candidate 6: ‘template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)’
409 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/gcc-15.2.0/include/c++/15.2.0/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed:
foo.cc:24:39: note: ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} is not derived from ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’
24 | long long cnt=1LL*sum*x;
| ^
/nix/gcc-15.2.0/include/c++/15.2.0/bits/valarray_after.h:409:5: note: candidate 7: ‘template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)’
409 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/gcc-15.2.0/include/c++/15.2.0/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed:
foo.cc:24:39: note: mismatched types ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’ and ‘long long int’
24 | long long cnt=1LL*sum*x;
| ^
/nix/gcc-15.2.0/include/c++/15.2.0/bits/valarray_after.h:409:5: note: candidate 8: ‘template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)’
409 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/gcc-15.2.0/include/c++/15.2.0/bits/valarray_after.h:409:5: note: template argument deduction/substitution failed:
foo.cc:24:39: note: ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} is not derived from ‘const std::_Expr<_Dom1, typename _Dom1::value_type>’
24 | long long cnt=1LL*sum*x;
| ^
/nix/gcc-15.2.0/include/c++/15.2.0/valarray:1200:1: note: candidate 9: ‘template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const valarray<_Tp>&, const valarray<_Tp>&)’
1200 | _DEFINE_BINARY_OPERATOR(*, __multiplies)
| ^~~~~~~~~~~~~~~~~~~~~~~
/nix/gcc-15.2.0/include/c++/15.2.0/valarray:1200:1: note: template argument deduction/substitution failed:
foo.cc:24:39: note: mismatched types ‘const std::valarray<_Tp>’ and ‘long long int’
24 | long long cnt=1LL*sum*x;
| ^
/nix/gcc-15.2.0/include/c++/15.2.0/valarray:1200:1: note: candidate 10: ‘template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)’
1200 | _DEFINE_BINARY_OPERATOR(*, __multiplies)
| ^~~~~~~~~~~~~~~~~~~~~~~
/nix/gcc-15.2.0/include/c++/15.2.0/valarray:1200:1: note: template argument deduction/substitution failed:
foo.cc:24:39: note: mismatched types ‘const std::valarray<_Tp>’ and ‘long long int’
24 | long long cnt=1LL*sum*x;
| ^
/nix/gcc-15.2.0/include/c++/15.2.0/valarray:1200:1: note: candidate 11: ‘template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)’
1200 | _DEFINE_BINARY_OPERATOR(*, __multiplies)
| ^~~~~~~~~~~~~~~~~~~~~~~
/nix/gcc-15.2.0/include/c++/15.2.0/valarray:1200:1: note: template argument deduction/substitution failed:
foo.cc:24:39: note: ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} is not derived from ‘const std::valarray<_Tp>’
24 | long long cnt=1LL*sum*x;
| ^