This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Strange C++ function pointer test


On Thu, Dec 31, 2015 at 10:49:18AM +0100, Dominik Vogt wrote:
> This snippet ist from the Plumhall 2014 xvs test suite:
> 
>   #if CXX03 || CXX11 || CXX14 
>   static float (*p1_)(float) = abs; 
>   ...
>   checkthat(__LINE__, p1_ != 0);
>   #endif
> 
> (With the testsuite specific macros doing the obvious).  abs() is
> declared as:
> 
>   int abs(int j)

I bet this depends on what headers are included.  Doesn't std::abs
have various overloads, including float -> float one?
So, is <cmath> included?  Is there using namespace std; before this?

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]