Re: [Boost-bugs] [Boost C++ Libraries] #162: Cannot compile octonion_test.cpp because of bug in sinc.hpp

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #162: Cannot compile octonion_test.cpp because of bug in sinc.hpp
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2007-11-08 17:20:13


#162: Cannot compile octonion_test.cpp because of bug in sinc.hpp
---------------------+------------------------------------------------------
  Reporter: nobody | Owner: hubert_holin
      Type: Bugs | Status: closed
 Milestone: | Component: math
   Version: None | Severity: Problem
Resolution: None | Keywords:
---------------------+------------------------------------------------------
Changes (by johnmaddock):

  * status: assigned => closed

Old description:

> {{{
> octonion_test.cpp cannot be compiled neither gcc 3.2
> nor Intel compiler because of the possible bug in
> boost/math/special_functions/sinc.hpp and in
> boost/math/special_functions/sinhc.hpp. Here are given
> the command line and the error (got from bjam build
> from “status” directory):
>
> g++ -c -Wall -ftemplate-depth-100 -g -O0 -fno-
> inline -I"../libs/math/test" -
> I "/home/users/vsysoltx/boost_loki/boost_1_30_0" -
> o "../libs/math/test/bin/octonion_test.test/gcc/bjam/archit
> ecture-native/debug-symbols-on/inlining-off/instruction-
> set-default/optimization-off/profiling-off/rtti-on/runtime-link-
> dynamic/shared-linkable-false/threading-single/vtable-
> thunks-
> default/octonion_test.o" "../libs/math/test/../octonion/oct
> onion_test.cpp"
>
> /home/users/vsysoltx/boost_loki/boost_1_30_0/boost/ma
> th/special_functions/sinc.hpp: In
> function `U<T> boost::math::sinc_pi(U<T>) [with T =
> float, U =
> boost::math::octonion]':
> ../libs/math/octonion/octonion_test.cpp:432:
> instantiated from here
> /home/users/vsysoltx/boost_loki/boost_1_30_0/boost/ma
> th/special_functions/sinc.hpp:109: no
> matching function for call to `abs(const
> boost::math::octonion<float>&)'
> <internal>:109: candidates are: int std::abs(int)
> /usr/include/c++/3.2/cstdlib:119: long int
> std::abs(long int)
> /usr/include/c++/3.2/cstdlib:142: long long int
> __gnu_cxx::abs(long long int)
> /usr/include/c++/3.2/cmath:87: double
> std::abs(double)
> /usr/include/c++/3.2/cmath:91: float std::abs
> (float)
> /usr/include/c++/3.2/cmath:95: long double
> std::abs(long
> double)
>
> The reason why compiler cannot find the appropriate
> boost::math::abs<T>(octonion<T>) definition is that here
> is used ::abs directive inside function. When this
> directive is used in the function definition, it hides the
> names from outermost namespaces. I don’t know why, I
> haven’t found this in standards, but that’s true both for
> gcc 3.2 and for Intel compiler. To compile these files I
> used a patch which is attached. In it the using directives
> are simply carried out of the function definition. That’s
> work with both compiler.
>
> For any questions you may contact me via
> Vyatcheslav.Sysoltsev_at_[hidden]
>
> }}}

New description:

 {{{
 octonion_test.cpp cannot be compiled neither gcc 3.2
 nor Intel compiler because of the possible bug in
 boost/math/special_functions/sinc.hpp and in
 boost/math/special_functions/sinhc.hpp. Here are given
 the command line and the error (got from bjam build
 from “status” directory):

     g++ -c -Wall -ftemplate-depth-100 -g -O0 -fno-
 inline -I"../libs/math/test" -
 I "/home/users/vsysoltx/boost_loki/boost_1_30_0" -
 o "../libs/math/test/bin/octonion_test.test/gcc/bjam/archit
 ecture-native/debug-symbols-on/inlining-off/instruction-
 set-default/optimization-off/profiling-off/rtti-on/runtime-link-
 dynamic/shared-linkable-false/threading-single/vtable-
 thunks-
 default/octonion_test.o" "../libs/math/test/../octonion/oct
 onion_test.cpp"

 /home/users/vsysoltx/boost_loki/boost_1_30_0/boost/ma
 th/special_functions/sinc.hpp: In
    function `U<T> boost::math::sinc_pi(U<T>) [with T =
 float, U =
    boost::math::octonion]':
 ../libs/math/octonion/octonion_test.cpp:432:
 instantiated from here
 /home/users/vsysoltx/boost_loki/boost_1_30_0/boost/ma
 th/special_functions/sinc.hpp:109: no
    matching function for call to `abs(const
 boost::math::octonion<float>&)'
 <internal>:109: candidates are: int std::abs(int)
 /usr/include/c++/3.2/cstdlib:119: long int
 std::abs(long int)
 /usr/include/c++/3.2/cstdlib:142: long long int
    __gnu_cxx::abs(long long int)
 /usr/include/c++/3.2/cmath:87: double
 std::abs(double)
 /usr/include/c++/3.2/cmath:91: float std::abs
 (float)
 /usr/include/c++/3.2/cmath:95: long double
 std::abs(long
    double)

 The reason why compiler cannot find the appropriate
 boost::math::abs<T>(octonion<T>) definition is that here
 is used ::abs directive inside function. When this
 directive is used in the function definition, it hides the
 names from outermost namespaces. I don’t know why, I
 haven’t found this in standards, but that’s true both for
 gcc 3.2 and for Intel compiler. To compile these files I
 used a patch which is attached. In it the using directives
 are simply carried out of the function definition. That’s
 work with both compiler.

 For any questions you may contact me via
 Vyatcheslav.Sysoltsev_at_[hidden]

 }}}

Comment:

 I'm closing this as obsolete: the test does now pass with gcc-3.x and
 current Intel compilers.

 John Maddock.

--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/162#comment:5>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.


This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:56 UTC