Boost logo

Boost :

Subject: [boost] [math] policy<discrete_quantile<real> > test's fail because multiple matches for 'real'
From: Brian Kuhl (kuhlenough_at_[hidden])
Date: 2018-06-21 17:01:29


When I compile with VxWorks 7/Clang v5/ Dinkum 700 there is an inline
real() function in global scope. Leading to a few errors like this:

-----------------------------------------------------------------------
clang-vxworks.compile.c++
../bin.v2/libs/math/test/test_poisson_float.test/clang-vxworks-4.2.1/debug/cross-compile-vxworks/static-only-on/test_poisson.o
    "/yow-build40-lx1/bkuhl/vx7/compilers/llvm-5.0.0.3/LINUX386/bin/clang"
-x c++ --target=x86_64 -m64 -mcmodel=large -fno-omit-frame-pointer
-fno-strict-aliasing -mno-implicit-float -fno-builtin -nostdlibinc
-nostdinc++ -fno-use-init-array -ftls-model=local-exec -ansi -std=c++14 -O2
-Wall -Wno-missing-braces -Wreturn-type -Wconversion -Wformat
-Wno-sign-conversion -Wno-c++11-narrowing
-isystem/yow-build40-lx1/bkuhl/workspace/VSB/usr/h
-isystem/yow-build40-lx1/bkuhl/workspace/VSB/usr/h/system
-isystem/yow-build40-lx1/bkuhl/workspace/VSB/usr/h/public -O0 -fno-inline
-Wall -g
-include/yow-build40-lx1/bkuhl/workspace/VSB/3pp/BOOST/boost_1_67_0/autoconf_vsbConfig_quote.h
-D_C99 -D_HAS_C9X -D__vxworks -D__VXWORKS__ -D__RTP__ -D__ELF__
-D__WRS_NO_DIRECT_TLS_ACCESS_FROM_RTP_TO_SHARED_LIB
-I/yow-build40-lx1/bkuhl/workspace/VSB/3pp/BOOST/boost_1_67_0
@/yow-build40-lx1/bkuhl/workspace/VSB/mk/_vsbuinc_cmdllvmBOOST
-D_VX_CPU=_VX_SIMLINUX -D_VX_TOOL_FAMILY=llvm -D_VX_TOOL=llvm
-D_nq_VSB_CONFIG_FILE=/yow-build40-lx1/bkuhl/workspace/VSB/h/config/vsbConfig.h
-I/yow-build40-lx1/bkuhl/workspace/VSB/share/h
-isystem/yow-build40-lx1/bkuhl/workspace/VSB/usr/h
-isystem/yow-build40-lx1/bkuhl/workspace/VSB/usr/h/system
-isystem/yow-build40-lx1/bkuhl/workspace/VSB/usr/h/public
-D_VSB_PUBLIC_HDR_DIR=/yow-build40-lx1/bkuhl/workspace/VSB/usr/h/public -I.
-DBOOST_ALL_NO_LIB=1 -DBOOST_CHRONO_STATIC_LINK=1
-DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_SYSTEM_STATIC_LINK=1
-DBOOST_TEST_NO_AUTO_LINK=1 -DBOOST_TIMER_STATIC_LINK=1
-DBOOST_UBLAS_UNSUPPORTED_COMPILER=0 -DTEST_FLOAT -I".."
-I"../libs/math/include_private" -I"../libs/math/test" -c -o
"../bin.v2/libs/math/test/test_poisson_float.test/clang-vxworks-4.2.1/debug/cross-compile-vxworks/static-only-on/test_poisson.o"
"../libs/math/test/test_poisson.cpp"
../libs/math/test/test_poisson.cpp:454:39: error: reference to 'real' is
ambiguous
     typedef policy<discrete_quantile<real> > P1;
                                      ^
/yow-build40-lx1/bkuhl/workspace/VSB/usr/h/public/complex.h:689:21: note:
candidate found by name lookup is 'real'
 inline long double real(_Lcomplex _Left)
                    ^
/yow-build40-lx1/bkuhl/workspace/VSB/usr/h/public/complex.h:543:14: note:
candidate found by name lookup is 'real'
inline float real(_Fcomplex _Left)
             ^
/yow-build40-lx1/bkuhl/workspace/VSB/usr/h/public/complex.h:397:15: note:
candidate found by name lookup is 'real'
inline double real(_Dcomplex _Left)
              ^
/yow-build40-lx1/bkuhl/workspace/VSB/3pp/BOOST/boost_1_67_0/boost/math/policies/policy.hpp:225:4:
note: candidate found by name lookup is
'boost::math::policies::discrete_quantile_policy_type::real'
   real,
   ^
../libs/math/test/test_poisson.cpp:454:39: error: unknown type name 'real'
     typedef policy<discrete_quantile<real> > P1;
                                      ^
../libs/math/test/test_poisson.cpp:454:45: error: expected a type
     typedef policy<discrete_quantile<real> > P1;
                                            ^
3 errors generated.
...failed clang-vxworks.compile.c++
../bin.v2/libs/math/test/test_poisson_float.test/clang-vxworks-4.2.1/debug/cross-compile-vxworks/static-only-on/test_poisson.o...
--------------------------------------------------------
I'd like to contribute a pull request to resolve this. But I'd like some
guidance; is a simple change that qualifies real acceptable.

      using namespace boost::math::policies;
- typedef policy<discrete_quantile<real> > P1;
+ typedef policy<discrete_quantile<boost::math::policies::real> > P1;
      typedef policy<discrete_quantile<integer_round_down> > P2;

Or is this something that should be added with
#ifdef __VXWORKS__


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk