boostorg / wave

Boost.org wave module
http://boost.org/libs/wave
21 stars 49 forks source link

Cannot build with clang-11 and libc++ in C++20 mode. #84

Closed qis closed 4 years ago

qis commented 4 years ago

This component fails to compile due to not using std::allocator_traits with clang-11 and libc++ in C++20 mode.

boost/wave/util/flex_string.hpp:547:25: error: no type named 'size_type' in 'std::__1::allocator<char>'
    typedef typename A::size_type size_type;
            ~~~~~~~~~~~~^~~~~~~~~

Command used to build boost:

b2 --layout=system
   --project-config=/mnt/c/Workspace/vcpkg/buildtrees/boost/x64-linux-dbg/config.jam
   --prefix=/mnt/c/Workspace/vcpkg/packages/boost_x64-linux/debug
   --libdir=/mnt/c/Workspace/vcpkg/packages/boost_x64-linux/debug/lib
   --exec-prefix=/mnt/c/Workspace/vcpkg/packages/boost_x64-linux/debug/bin
   --includedir=/mnt/c/Workspace/vcpkg/packages/boost_x64-linux/debug/../include
   --cmakedir=/mnt/c/Workspace/vcpkg/packages/boost_x64-linux/debug/share/boost
   --build-dir=/mnt/c/Workspace/vcpkg/buildtrees/boost/x64-linux-dbg/build
   --without-graph_parallel --without-mpi --without-python
   --includedir=/mnt/c/Workspace/vcpkg/packages/boost_x64-linux/include
   architecture=x86 address-model=64
   variant=debug threading=multi
   link=static runtime-link=shared
   debug-symbols=on install

The log component has a similar issue: https://github.com/boostorg/log/issues/114

jefftrull commented 4 years ago

Thanks for the bug report. We fixed some of these but missed the rest :(

jefftrull commented 4 years ago

@qis would you try my branch and see if it fixes your problem? https://github.com/jefftrull/wave/tree/bugfix/allocator-traits

qis commented 4 years ago

@jefftrull Thanks! It looks better now, but doesn't compile yet: install-x64-linux-dbg-out.log

jefftrull commented 4 years ago

Thanks again and sorry to do this iteratively - for some reason my clang doesn't flag these :( I have updated my branch again, can you recheck?

qis commented 4 years ago

Awesome! Commit c9d096b fixed the build. If you're interested in warnings, here they are: install-x64-linux-dbg-out.log

Could it be that you couldn't reproduce the problems because clang was still using libstdc++? I built LLVM with -DCLANG_DEFAULT_CXX_STDLIB="libc++".

Thank you very much! :)

mclow commented 4 years ago

I just ran into this while testing the 1.73.0 beta 1 release candidate.

mclow commented 4 years ago

I'll try on develop to see

glenfe commented 4 years ago

@jefftrull I left comments on your pull request.

jefftrull commented 4 years ago

@mclow is this holding up 1.73? Maybe I should retarget to master as a bug fix?

mclow commented 4 years ago

@mclow is this holding up 1.73? Maybe I should retarget to master as a bug fix?

IMHO, this is not worth holding up the beta for. Unreleased compiler, unreleased standard. However, I think it ought to be fixed for the 1.73 release, which is in a couple weeks.