boostorg / wave

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

Fix compilation issue caused by std::allocator member removal in C++20 #72

Closed stac47 closed 4 years ago

stac47 commented 4 years ago

This PR fixes the compilation problem caused by the removal of some member typdef in std::allocator since C++20 standard.

In file included from ./boost/wave/wave_config.hpp:230,
                 from libs/wave/src/instantiate_cpp_exprgrammar.cpp:14:
./boost/wave/util/flex_string.hpp: In instantiation of ‘class boost::wave::util::CowString<boost::wave::util::AllocatorStringStorage<char> >’:
./boost/wave/util/flex_string.hpp:1417:7:   required from ‘class boost::wave::util::flex_string<char, std::char_traits<char>, std::allocator<char>, boost::wave::util::CowString<boost::wave::util::AllocatorStringStorage<char> > >’
./boost/wave/util/file_position.hpp:85:17:   required from ‘struct boost::wave::util::file_position<boost::wave::util::flex_string<char, std::char_traits<char>, std::allocator<char>, boost::wave::util::CowString<boost::wave::util::AllocatorStringStorage<char> > > >’
./boost/wave/util/file_position.hpp:161:16:   required from here
./boost/wave/util/flex_string.hpp:1205:41: error: no type named ‘reference’ in ‘class boost::wave::util::AllocatorStringStorage<char>’
 1205 |     typedef typename Storage::reference reference;
      |                                         ^~~~~~~~~
./boost/wave/util/flex_string.hpp: In instantiation of ‘class boost::wave::util::flex_string<char, std::char_traits<char>, std::allocator<char>, boost::wave::util::CowString<boost::wave::util::AllocatorStringStorage<char> > >’:
./boost/wave/util/file_position.hpp:85:17:   required from ‘struct boost::wave::util::file_position<boost::wave::util::flex_string<char, std::char_traits<char>, std::allocator<char>, boost::wave::util::CowString<boost::wave::util::AllocatorStringStorage<char> > > >’
./boost/wave/util/file_position.hpp:161:16:   required from here
./boost/wave/util/flex_string.hpp:1467:35: error: no type named ‘reference’ in ‘class std::allocator<char>’
 1467 |     typedef typename A::reference reference;
      |                                   ^~~~~~~~~
./boost/wave/util/flex_string.hpp:1468:41: error: no type named ‘const_reference’ in ‘class std::allocator<char>’
 1468 |     typedef typename A::const_reference const_reference;
      |                                         ^~~~~~~~~~~~~~~
./boost/wave/util/flex_string.hpp:1469:33: error: no type named ‘pointer’ in ‘class std::allocator<char>’
 1469 |     typedef typename A::pointer pointer;
      |                                 ^~~~~~~
./boost/wave/util/flex_string.hpp:1470:39: error: no type named ‘const_pointer’ in ‘class std::allocator<char>’
 1470 |     typedef typename A::const_pointer const_pointer;
      |                                       ^~~~~~~~~~~~~
jefftrull commented 4 years ago

It would be nice to have this fix for 1.73. If @stac47 doesn't do the allocator_traits change maybe we should?

hkaiser commented 4 years ago

@jefftrull I think this is good to go now. What do you think?

jefftrull commented 4 years ago

LGTM also but let's let CI finish running just to be sure. I should explore getting C++20 in Travis! Thanks for the contribution @stac47