boostorg / chrono

Boost.org chrono module
http://boost.org/libs/chrono
15 stars 52 forks source link

unique_ptr compilation error with g++ and clang++ #69

Closed erdemcaliskan closed 1 year ago

erdemcaliskan commented 1 year ago

I'm can't compile my code when boost/chrono/chrono_io.hpp is included. I tried compilers:

g++ (Ubuntu 12.2.0-3ubuntu1) 12.2.0

and

AMD clang version 14.0.6 (CLANG: AOCC_4.0.0-Build#434 2022_10_28) (based on LLVM Mirror.Version.14.0.6) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /opt/AMD/aocc-compiler-4.0.0/bin

Error is:

In file included from boost_1_80_0/aocc/include/boost/chrono/chrono_io.hpp:29: In file included from boost_1_80_0/aocc/include/boost/chrono/io_v1/chrono_io.hpp:26: In file included from boost_1_80_0/aocc/include/boost/chrono/detail/scan_keyword.hpp:22: boost_1_80_0/aocc/include/boost/move/unique_ptr.hpp:133:12: error: expected class member or base class name : D(), m_p() ^ boost_1_80_0/aocc/include/boost/move/unique_ptr.hpp:137:12: error: expected class member or base class name : D(), m_p(p) ^ boost_1_80_0/aocc/include/boost/move/unique_ptr.hpp:141:14: error: expected class member or base class name : D(d1), m_p(p) ^ boost_1_80_0/aocc/include/boost/move/unique_ptr.hpp:146:34: error: expected class member or base class name : D(::boost::forward(d)), m_p(p) ^

mclow commented 1 year ago

A small, self contained test case would be a big help here.

mclow commented 1 year ago

I tried this:

#include <boost/chrono/chrono_io.hpp>
int main () {}

and it compiled w/o error. (apple clang 14, libc++, c++11, boost trunk)

mclow commented 1 year ago

Also compiled w/o error using boost 1.80.0 (same config as above)

erdemcaliskan commented 1 year ago

Thank you for the feedback, I'll do some checks on my side.