json: Boost 1.80 build failure with gcc11/gcc12: json/impl/parse.ipp: error: no match for 'operator=' (no such error with 1.79)

:info:build darwin.compile.c++ bin.v2/libs/json/build/darwin-12.2.0/release/threading-multi/visibility-hidden/src.o
:info:build     "/opt/local/bin/g++-mp-12"   -fvisibility-inlines-hidden -Os -std=gnu++11 -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc  -fPIC -m32 -O3 -Wall -fvisibility=hidden -dynamic -gdwarf-2 -fexceptions -Wno-inline  -DBOOST_ALL_NO_LIB=1 -DBOOST_CONTAINER_DYN_LINK=1 -DBOOST_JSON_DYN_LINK=1 -DBOOST_JSON_SOURCE -DNDEBUG  -I"."  -c -o "bin.v2/libs/json/build/darwin-12.2.0/release/threading-multi/visibility-hidden/src.o" "libs/json/src/src.cpp"
:info:build In file included from ./boost/json/src.hpp:37,
:info:build                  from libs/json/src/src.cpp:10:
:info:build ./boost/json/impl/parse.ipp: In function 'boost::json::value boost::json::parse(string_view, std::error_code&, storage_ptr, const parse_options&)':
:info:build ./boost/json/impl/parse.ipp:46:10: error: no match for 'operator=' (operand types are 'std::error_code' and 'boost::json::error_code' {aka 'boost::system::error_code'})
:info:build    46 |     ec = jec;
:info:build       |          ^~~
:info:build In file included from /opt/local/include/gcc12/c++/bits/ios_base.h:46,
:info:build                  from /opt/local/include/gcc12/c++/ios:42,
:info:build                  from ./boost/core/detail/string_view.hpp:30,
:info:build                  from ./boost/json/string_view.hpp:14,
:info:build                  from ./boost/json/kind.hpp:14,
:info:build                  from ./boost/json/array.hpp:14,
:info:build                  from ./boost/json.hpp:15,
:info:build                  from ./boost/json/src.hpp:27:
:info:build /opt/local/include/gcc12/c++/system_error:225:7: note: candidate: 'template<class _ErrorCodeEnum> typename std::enable_if<std::is_error_code_enum<_Tp>::value, std::error_code&>::type std::error_code::operator=(_ErrorCodeEnum)'
:info:build   225 |       operator=(_ErrorCodeEnum __e) noexcept
:info:build       |       ^~~~~~~~
:info:build /opt/local/include/gcc12/c++/system_error:225:7: note:   template argument deduction/substitution failed:
:info:build /opt/local/include/gcc12/c++/system_error: In substitution of 'template<class _ErrorCodeEnum> typename std::enable_if<std::is_error_code_enum<_Tp>::value, std::error_code&>::type std::error_code::operator=(_ErrorCodeEnum) [with _ErrorCodeEnum = boost::system::error_code]':
:info:build ./boost/json/impl/parse.ipp:46:10:   required from here
:info:build /opt/local/include/gcc12/c++/system_error:225:7: error: no type named 'type' in 'struct std::enable_if<false, std::error_code&>'
:info:build /opt/local/include/gcc12/c++/system_error:196:9: note: candidate: 'std::error_code& std::error_code::operator=(const std::error_code&)'
:info:build   196 |   class error_code
:info:build       |         ^~~~~~~~~~
:info:build /opt/local/include/gcc12/c++/system_error:196:9: note:   no known conversion for argument 1 from 'boost::json::error_code' {aka 'boost::system::error_code'} to 'const std::error_code&'
:info:build /opt/local/include/gcc12/c++/system_error:196:9: note: candidate: 'std::error_code& std::error_code::operator=(std::error_code&&)'
:info:build /opt/local/include/gcc12/c++/system_error:196:9: note:   no known conversion for argument 1 from 'boost::json::error_code' {aka 'boost::system::error_code'} to 'std::error_code&&'
:info:build In file included from ./boost/json/src.hpp:38:
:info:build ./boost/json/impl/parser.ipp: In member function 'std::size_t boost::json::parser::write_some(const char*, std::size_t, std::error_code&)':
:info:build ./boost/json/impl/parser.ipp:80:10: error: no match for 'operator=' (operand types are 'std::error_code' and 'boost::json::error_code' {aka 'boost::system::error_code'})
:info:build    80 |     ec = jec;
:info:build       |          ^~~
:info:build /opt/local/include/gcc12/c++/system_error:225:7: note: candidate: 'template<class _ErrorCodeEnum> typename std::enable_if<std::is_error_code_enum<_Tp>::value, std::error_code&>::type std::error_code::operator=(_ErrorCodeEnum)'
:info:build   225 |       operator=(_ErrorCodeEnum __e) noexcept
:info:build       |       ^~~~~~~~
:info:build /opt/local/include/gcc12/c++/system_error:225:7: note:   template argument deduction/substitution failed:
:info:build /opt/local/include/gcc12/c++/system_error: In substitution of 'template<class _ErrorCodeEnum> typename std::enable_if<std::is_error_code_enum<_Tp>::value, std::error_code&>::type std::error_code::operator=(_ErrorCodeEnum) [with _ErrorCodeEnum = boost::system::error_code]':
:info:build ./boost/json/impl/parser.ipp:80:10:   required from here
:info:build /opt/local/include/gcc12/c++/system_error:225:7: error: no type named 'type' in 'struct std::enable_if<false, std::error_code&>'
:info:build /opt/local/include/gcc12/c++/system_error:196:9: note: candidate: 'std::error_code& std::error_code::operator=(const std::error_code&)'
:info:build   196 |   class error_code
:info:build       |         ^~~~~~~~~~
:info:build /opt/local/include/gcc12/c++/system_error:196:9: note:   no known conversion for argument 1 from 'boost::json::error_code' {aka 'boost::system::error_code'} to 'const std::error_code&'
:info:build /opt/local/include/gcc12/c++/system_error:196:9: note: candidate: 'std::error_code& std::error_code::operator=(std::error_code&&)'
:info:build /opt/local/include/gcc12/c++/system_error:196:9: note:   no known conversion for argument 1 from 'boost::json::error_code' {aka 'boost::system::error_code'} to 'std::error_code&&'
:info:build ./boost/json/impl/parser.ipp: In member function 'std::size_t boost::json::parser::write(const char*, std::size_t, std::error_code&)':
:info:build ./boost/json/impl/parser.ipp:125:10: error: no match for 'operator=' (operand types are 'std::error_code' and 'boost::json::error_code' {aka 'boost::system::error_code'})
:info:build   125 |     ec = jec;
:info:build       |          ^~~
:info:build /opt/local/include/gcc12/c++/system_error:225:7: note: candidate: 'template<class _ErrorCodeEnum> typename std::enable_if<std::is_error_code_enum<_Tp>::value, std::error_code&>::type std::error_code::operator=(_ErrorCodeEnum)'
:info:build   225 |       operator=(_ErrorCodeEnum __e) noexcept
:info:build       |       ^~~~~~~~
:info:build /opt/local/include/gcc12/c++/system_error:225:7: note:   template argument deduction/substitution failed:
:info:build /opt/local/include/gcc12/c++/system_error: In substitution of 'template<class _ErrorCodeEnum> typename std::enable_if<std::is_error_code_enum<_Tp>::value, std::error_code&>::type std::error_code::operator=(_ErrorCodeEnum) [with _ErrorCodeEnum = boost::system::error_code]':
:info:build ./boost/json/impl/parser.ipp:125:10:   required from here
:info:build /opt/local/include/gcc12/c++/system_error:225:7: error: no type named 'type' in 'struct std::enable_if<false, std::error_code&>'
:info:build /opt/local/include/gcc12/c++/system_error:196:9: note: candidate: 'std::error_code& std::error_code::operator=(const std::error_code&)'
:info:build   196 |   class error_code
:info:build       |         ^~~~~~~~~~
:info:build /opt/local/include/gcc12/c++/system_error:196:9: note:   no known conversion for argument 1 from 'boost::json::error_code' {aka 'boost::system::error_code'} to 'const std::error_code&'
:info:build /opt/local/include/gcc12/c++/system_error:196:9: note: candidate: 'std::error_code& std::error_code::operator=(std::error_code&&)'
:info:build /opt/local/include/gcc12/c++/system_error:196:9: note:   no known conversion for argument 1 from 'boost::json::error_code' {aka 'boost::system::error_code'} to 'std::error_code&&'
:info:build In file included from ./boost/json/src.hpp:39:
:info:build ./boost/json/impl/pointer.ipp: In member function 'const boost::json::value* boost::json::value::find_pointer(boost::json::string_view, std::error_code&) const':
:info:build ./boost/json/impl/pointer.ipp:328:10: error: no match for 'operator=' (operand types are 'std::error_code' and 'boost::json::error_code' {aka 'boost::system::error_code'})
:info:build   328 |     ec = jec;
:info:build       |          ^~~
:info:build /opt/local/include/gcc12/c++/system_error:225:7: note: candidate: 'template<class _ErrorCodeEnum> typename std::enable_if<std::is_error_code_enum<_Tp>::value, std::error_code&>::type std::error_code::operator=(_ErrorCodeEnum)'
:info:build   225 |       operator=(_ErrorCodeEnum __e) noexcept
:info:build       |       ^~~~~~~~
:info:build /opt/local/include/gcc12/c++/system_error:225:7: note:   template argument deduction/substitution failed:
:info:build /opt/local/include/gcc12/c++/system_error: In substitution of 'template<class _ErrorCodeEnum> typename std::enable_if<std::is_error_code_enum<_Tp>::value, std::error_code&>::type std::error_code::operator=(_ErrorCodeEnum) [with _ErrorCodeEnum = boost::system::error_code]':
:info:build ./boost/json/impl/pointer.ipp:328:10:   required from here
:info:build /opt/local/include/gcc12/c++/system_error:225:7: error: no type named 'type' in 'struct std::enable_if<false, std::error_code&>'
:info:build /opt/local/include/gcc12/c++/system_error:196:9: note: candidate: 'std::error_code& std::error_code::operator=(const std::error_code&)'
:info:build   196 |   class error_code
:info:build       |         ^~~~~~~~~~
:info:build /opt/local/include/gcc12/c++/system_error:196:9: note:   no known conversion for argument 1 from 'boost::json::error_code' {aka 'boost::system::error_code'} to 'const std::error_code&'
:info:build /opt/local/include/gcc12/c++/system_error:196:9: note: candidate: 'std::error_code& std::error_code::operator=(std::error_code&&)'
:info:build /opt/local/include/gcc12/c++/system_error:196:9: note:   no known conversion for argument 1 from 'boost::json::error_code' {aka 'boost::system::error_code'} to 'std::error_code&&'
:info:build In file included from ./boost/json/src.hpp:43:
:info:build ./boost/json/impl/stream_parser.ipp: In member function 'std::size_t boost::json::stream_parser::write_some(const char*, std::size_t, std::error_code&)':
:info:build ./boost/json/impl/stream_parser.ipp:78:10: error: no match for 'operator=' (operand types are 'std::error_code' and 'boost::json::error_code' {aka 'boost::system::error_code'})
:info:build    78 |     ec = jec;
:info:build       |          ^~~
:info:build /opt/local/include/gcc12/c++/system_error:225:7: note: candidate: 'template<class _ErrorCodeEnum> typename std::enable_if<std::is_error_code_enum<_Tp>::value, std::error_code&>::type std::error_code::operator=(_ErrorCodeEnum)'
:info:build   225 |       operator=(_ErrorCodeEnum __e) noexcept
:info:build       |       ^~~~~~~~
:info:build /opt/local/include/gcc12/c++/system_error:225:7: note:   template argument deduction/substitution failed:
:info:build /opt/local/include/gcc12/c++/system_error: In substitution of 'template<class _ErrorCodeEnum> typename std::enable_if<std::is_error_code_enum<_Tp>::value, std::error_code&>::type std::error_code::operator=(_ErrorCodeEnum) [with _ErrorCodeEnum = boost::system::error_code]':
:info:build ./boost/json/impl/stream_parser.ipp:78:10:   required from here
:info:build /opt/local/include/gcc12/c++/system_error:225:7: error: no type named 'type' in 'struct std::enable_if<false, std::error_code&>'
:info:build /opt/local/include/gcc12/c++/system_error:196:9: note: candidate: 'std::error_code& std::error_code::operator=(const std::error_code&)'
:info:build   196 |   class error_code
:info:build       |         ^~~~~~~~~~
:info:build /opt/local/include/gcc12/c++/system_error:196:9: note:   no known conversion for argument 1 from 'boost::json::error_code' {aka 'boost::system::error_code'} to 'const std::error_code&'
:info:build /opt/local/include/gcc12/c++/system_error:196:9: note: candidate: 'std::error_code& std::error_code::operator=(std::error_code&&)'
:info:build /opt/local/include/gcc12/c++/system_error:196:9: note:   no known conversion for argument 1 from 'boost::json::error_code' {aka 'boost::system::error_code'} to 'std::error_code&&'
:info:build ./boost/json/impl/stream_parser.ipp: In member function 'std::size_t boost::json::stream_parser::write(const char*, std::size_t, std::error_code&)':
:info:build ./boost/json/impl/stream_parser.ipp:123:10: error: no match for 'operator=' (operand types are 'std::error_code' and 'boost::json::error_code' {aka 'boost::system::error_code'})
:info:build   123 |     ec = jec;
:info:build       |          ^~~
:info:build /opt/local/include/gcc12/c++/system_error:225:7: note: candidate: 'template<class _ErrorCodeEnum> typename std::enable_if<std::is_error_code_enum<_Tp>::value, std::error_code&>::type std::error_code::operator=(_ErrorCodeEnum)'
:info:build   225 |       operator=(_ErrorCodeEnum __e) noexcept
:info:build       |       ^~~~~~~~
:info:build /opt/local/include/gcc12/c++/system_error:225:7: note:   template argument deduction/substitution failed:
:info:build /opt/local/include/gcc12/c++/system_error: In substitution of 'template<class _ErrorCodeEnum> typename std::enable_if<std::is_error_code_enum<_Tp>::value, std::error_code&>::type std::error_code::operator=(_ErrorCodeEnum) [with _ErrorCodeEnum = boost::system::error_code]':
:info:build ./boost/json/impl/stream_parser.ipp:123:10:   required from here
:info:build /opt/local/include/gcc12/c++/system_error:225:7: error: no type named 'type' in 'struct std::enable_if<false, std::error_code&>'
:info:build /opt/local/include/gcc12/c++/system_error:196:9: note: candidate: 'std::error_code& std::error_code::operator=(const std::error_code&)'
:info:build   196 |   class error_code
:info:build       |         ^~~~~~~~~~
:info:build /opt/local/include/gcc12/c++/system_error:196:9: note:   no known conversion for argument 1 from 'boost::json::error_code' {aka 'boost::system::error_code'} to 'const std::error_code&'
:info:build /opt/local/include/gcc12/c++/system_error:196:9: note: candidate: 'std::error_code& std::error_code::operator=(std::error_code&&)'
:info:build /opt/local/include/gcc12/c++/system_error:196:9: note:   no known conversion for argument 1 from 'boost::json::error_code' {aka 'boost::system::error_code'} to 'std::error_code&&'
:info:build ./boost/json/impl/stream_parser.ipp: In member function 'void boost::json::stream_parser::finish(std::error_code&)':
:info:build ./boost/json/impl/stream_parser.ipp:166:10: error: no match for 'operator=' (operand types are 'std::error_code' and 'boost::json::error_code' {aka 'boost::system::error_code'})
:info:build   166 |     ec = jec;
:info:build       |          ^~~
:info:build /opt/local/include/gcc12/c++/system_error:225:7: note: candidate: 'template<class _ErrorCodeEnum> typename std::enable_if<std::is_error_code_enum<_Tp>::value, std::error_code&>::type std::error_code::operator=(_ErrorCodeEnum)'
:info:build   225 |       operator=(_ErrorCodeEnum __e) noexcept
:info:build       |       ^~~~~~~~
:info:build /opt/local/include/gcc12/c++/system_error:225:7: note:   template argument deduction/substitution failed:
:info:build /opt/local/include/gcc12/c++/system_error: In substitution of 'template<class _ErrorCodeEnum> typename std::enable_if<std::is_error_code_enum<_Tp>::value, std::error_code&>::type std::error_code::operator=(_ErrorCodeEnum) [with _ErrorCodeEnum = boost::system::error_code]':
:info:build ./boost/json/impl/stream_parser.ipp:166:10:   required from here
:info:build /opt/local/include/gcc12/c++/system_error:225:7: error: no type named 'type' in 'struct std::enable_if<false, std::error_code&>'
:info:build /opt/local/include/gcc12/c++/system_error:196:9: note: candidate: 'std::error_code& std::error_code::operator=(const std::error_code&)'
:info:build   196 |   class error_code
:info:build       |         ^~~~~~~~~~

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 23 (13 by maintainers)

Most upvoted comments

Until we figure out how to properly fix this, you should be able to compile Boost 1.80 by defining BOOST_SYSTEM_HAS_SYSTEM_ERROR manually by adding define=BOOST_SYSTEM_HAS_SYSTEM_ERROR to the b2 command line.

Users of Boost 1.80 however might have to do that as well, although it should mostly work.

Oh, my browser haven’t pulled the discussion before I posted. Looks like you’ve figured it out!

We test gcc 11 and 12, although not on Apple. Can you give me the full list of compiler flags being used? b2 -d+2 prints commands being executed by the build system.