My apologies if this is not the right place to ask but I am not sure
where else to find support for Clang under OSX.
I am having some issues compiling my own code which works with GCC but
fails using Clang, and I can't work out why. I am hoping that someone
here might be able to tell me whether it is an issue with my code or
a bug in Clang.
The full build log is online, but the relevant error is this:
candidate constructor not viable:
no known conversion from '
unsigned long long, std::__1::weak_ptr<camoto::stream::seg>
' to 'fn_truncate_sub'
(aka 'function<void (camoto::stream::output_sub *, len)>')
for 4th argument
It seems to be complaining that it can't construct an object because
the final parameter in the constructor is of the wrong type.
I can't work out why this is a problem however. GCC accepts the code,
and so does Clang under Linux. It's only Clang running on OSX that
has this problem. Unfortunately as this is all run through Travis CI,
I don't have much access to the build environment to do any
It looks like the failing OSX builds use this version of Clang:
$ clang --version
Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
Whereas the successful Linux build is this version:
$ clang --version
clang version 3.4 (tags/RELEASE_34/final)
I don't know how to compare clang version 600 to version 3.4 so I am
not sure which one is newer. Perhaps the OSX version is newer and
has stricter checks, which is why it's failing with an error?
If anyone is willing or able to investigate further, the code I am
compiling is on git. The problem line of code is , and the
function being bound is just above that. The constructor being called
is declared at . The last parameter of the constructor, the one
Clang is complaining about, has a type declared at . The data
types ("len") are "unsigned long long" and declared at .
The only odd thing I can see is that the suspect parameter takes an
std::function returning void, but the std::function I am passing
returns bool. I tried changing std::bind() to std::bind<void>() to
account for this but it did not change the error.
Is anyone able to shed any light on what's happening here? I'm
afraid I'm at somewhat of a loss to understand the cause of the