CURRENT: CLANG 3.3 and -stad=c++11 and -stdlib=libc++: isnan()/isninf() oddity

From: O. Hartmann <ohartman_at_zedat.fu-berlin.de>
Date: Wed, 10 Jul 2013 15:58:09 +0200
Whe I try to compile the sources of a port in spe (devel/pocl), which
is now out as RC6, I receive this error shown below:

[...]
../vecmathlib/pocl/../vec_sse_double1.h:451:38: error:
conversion from 'int' to 'boolvec_t' (aka 'boolvec<real_t, size>') is
ambiguous boolvec_t isinf() const { return std::isinf(v); }
^~~~~~~~~~~~~ ../vecmathlib/pocl/../vec_sse_double1.h:75:5: note:
candidate constructor boolvec(bvector_t x): v(x) {}
    ^
../vecmathlib/pocl/../vec_sse_double1.h:76:5: note: candidate
constructor boolvec(bool a): v(a) {}
[...]

Compilation is performed on the most recent CURRENT with CLANG 3.3 and
devel/llvm (which is obviously stuck with 3.2 for now) and option
switches -std=c++11 -stdlib=libc++.

As I was told, in standard C++11, isnan(), isinf() and fellows now
should return "bool", not int as this seems obviously the case as the
error documents and I was able to check with a small program.

Is this a bug in FreeBSD's implementation of libc++? Or am I doing
something wrong?

I'm new to C++/C++11.


Some advice or explanation could be helpful.

regards,

Oliver

Received on Wed Jul 10 2013 - 11:58:11 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:39 UTC