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

O. Hartmann ohartman at zedat.fu-berlin.de
Wed Jul 10 13:58:11 UTC 2013


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-current/attachments/20130710/64e15ac6/attachment.sig>


More information about the freebsd-current mailing list