devel/boost issues regarding boost/chrono/duration.hpp constexpr definitions with clang
Dimitry Andric
dim at FreeBSD.org
Wed Dec 11 15:50:22 UTC 2013
On 11 Dec 2013, at 13:22, Gergely CZUCZY <gergely.czuczy at harmless.hu> wrote:
> Could you please update boost to 1.55? There's seems to be some issues
> with the current version, which might be fixed later.
>
> Namely, on a 9.x default install, built with defaults (gcc as defcc),
> when one is trying to include boost/thread/shared_mutex.hpp and build
> that file with clang:
>
> --- BEGIN boostmtx.cc ---
> #include <boost/thread/shared_mutex.hpp>
>
> int main() { return 0; }
> --- END boostmtx.cc ---
>
> And when trying to build it:
> $ CXXFLAGS="-Werror -pedantic -std=c++11 -I/usr/local/include" CXX=clang++ make boostmtx
> clang++ -Werror -pedantic -std=c++11 -I/usr/local/include boostmtx.cc -o boostmtx
> In file included from boostmtx.cc:1:
> In file included from /usr/local/include/boost/thread/shared_mutex.hpp:21:
> In file included from /usr/local/include/boost/thread/pthread/shared_mutex.hpp:13:
> In file included from /usr/local/include/boost/thread/mutex.hpp:16:
> In file included from /usr/local/include/boost/thread/pthread/mutex.hpp:12:
> In file included from /usr/local/include/boost/thread/locks.hpp:18:
> In file included from /usr/local/include/boost/chrono/time_point.hpp:33:
> /usr/local/include/boost/chrono/duration.hpp:667:28: error: 'constexpr' non-static member function will not be implicitly 'const' in
> C++1y; add 'const' to avoid a change in behavior [-Werror,-Wconstexpr-not-const]
> BOOST_CONSTEXPR bool operator()(const LhsDuration& lhs, const RhsDuration& rhs)
> ^
> const
Have a look at http://svnweb.freebsd.org/changeset/base/251066 for a fix.
Basically, just make the operator() functions themselves const.
-Dimitry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20131211/ebcfbb7d/attachment.sig>
More information about the freebsd-ports
mailing list