Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

g++ 12.1.1 fails to compile Boost.GIL with -std=c++20 #718

Closed
aleck099 opened this issue Aug 24, 2022 · 3 comments
Closed

g++ 12.1.1 fails to compile Boost.GIL with -std=c++20 #718

aleck099 opened this issue Aug 24, 2022 · 3 comments

Comments

@aleck099
Copy link

Actual behavior

g++ -std=c++20 -c resize.cpp
Output:

In file included from /usr/include/boost/gil/extension/io/jpeg/read.hpp:13,
                 from /usr/include/boost/gil/extension/io/jpeg.hpp:11,
                 from resize.cpp:2:
/usr/include/boost/gil/extension/io/jpeg/tags.hpp:144:35: error: expected unqualified-id before ‘)’ token
  144 |     image_read_settings<jpeg_tag>()
      |                                   ^
In file included from /usr/include/boost/gil/extension/io/jpeg/read.hpp:21:
/usr/include/boost/gil/io/make_reader.hpp: In instantiation of ‘typename boost::gil::get_reader<String, FormatTag, ConversionPolicy>::type boost::gil::make_reader(const String&, const FormatTag&, const ConversionPolicy&, typename std::enable_if<typename boost::mp11::detail::mp_and_impl<boost::mp11::mp_list<detail::is_supported_path_spec<String>, is_format_tag<FormatTag> >, void>::type::value>::type*) [with String = char [9]; FormatTag = jpeg_tag; ConversionPolicy = detail::read_and_no_convert; typename get_reader<String, FormatTag, ConversionPolicy>::type = reader<detail::file_stream_device<jpeg_tag>, jpeg_tag, detail::read_and_no_convert>; typename std::enable_if<typename boost::mp11::detail::mp_and_impl<boost::mp11::mp_list<detail::is_supported_path_spec<String>, is_format_tag<FormatTag> >, void>::type::value>::type = void; typename boost::mp11::detail::mp_and_impl<boost::mp11::mp_list<detail::is_supported_path_spec<String>, is_format_tag<FormatTag> >, void>::type = std::integral_constant<bool, true>]’:
/usr/include/boost/gil/io/read_image.hpp:167:34:   required from ‘void boost::gil::read_image(const String&, Image&, const FormatTag&, typename std::enable_if<typename boost::mp11::detail::mp_and_impl<boost::mp11::mp_list<detail::is_supported_path_spec<String>, is_format_tag<FormatTag>, is_read_supported<typename get_pixel_type<typename Image::view_t>::type, FormatTag> >, void>::type::value>::type*) [with String = char [9]; Image = image<pixel<unsigned char, layout<boost::mp11::mp_list<red_t, green_t, blue_t> > >, false, std::allocator<unsigned char> >; FormatTag = jpeg_tag; typename std::enable_if<typename boost::mp11::detail::mp_and_impl<boost::mp11::mp_list<detail::is_supported_path_spec<String>, is_format_tag<FormatTag>, is_read_supported<typename get_pixel_type<typename Image::view_t>::type, FormatTag> >, void>::type::value>::type = void; typename boost::mp11::detail::mp_and_impl<boost::mp11::mp_list<detail::is_supported_path_spec<String>, is_format_tag<FormatTag>, is_read_supported<typename get_pixel_type<typename Image::view_t>::type, FormatTag> >, void>::type = std::integral_constant<bool, true>; typename get_pixel_type<typename Image::view_t>::type = pixel<unsigned char, layout<boost::mp11::mp_list<red_t, green_t, blue_t> > >; typename Image::view_t = image_view<memory_based_2d_locator<memory_based_step_iterator<pixel<unsigned char, layout<boost::mp11::mp_list<red_t, green_t, blue_t> > >*> > >]’
resize.cpp:16:19:   required from here
/usr/include/boost/gil/io/make_reader.hpp:134:35: error: no matching function for call to ‘boost::gil::image_read_settings<boost::gil::jpeg_tag>::image_read_settings()’
  134 |     return make_reader(file_name, image_read_settings<FormatTag>(), cc);
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/boost/gil/extension/io/jpeg/tags.hpp:153:5: note: candidate: ‘boost::gil::image_read_settings<boost::gil::jpeg_tag>::image_read_settings(const boost::gil::point_t&, const boost::gil::point_t&, boost::gil::property_base<J_DCT_METHOD>::type)’
  153 |     image_read_settings( const point_t&        top_left
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/boost/gil/extension/io/jpeg/tags.hpp:153:5: note:   candidate expects 3 arguments, 0 provided
/usr/include/boost/gil/extension/io/jpeg/tags.hpp:141:8: note: candidate: ‘constexpr boost::gil::image_read_settings<boost::gil::jpeg_tag>::image_read_settings(const boost::gil::image_read_settings<boost::gil::jpeg_tag>&)’
  141 | struct image_read_settings< jpeg_tag > : public image_read_settings_base
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/boost/gil/extension/io/jpeg/tags.hpp:141:8: note:   candidate expects 1 argument, 0 provided
/usr/include/boost/gil/extension/io/jpeg/tags.hpp:141:8: note: candidate: ‘constexpr boost::gil::image_read_settings<boost::gil::jpeg_tag>::image_read_settings(boost::gil::image_read_settings<boost::gil::jpeg_tag>&&)’
/usr/include/boost/gil/extension/io/jpeg/tags.hpp:141:8: note:   candidate expects 1 argument, 0 provided

NOTE:

Same bug does not happen with -std=c++11/c++14/c++17, only with -std=c++20
Cannot reproduce on clang

Expected behavior

Successfully compiles

C++ Minimal Working Example

resize.cpp

Environment

  • Compiler version: 12.1.1
  • Build settings:
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --with-build-config=bootstrap-lto --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.1.1 20220730 (GCC) 
  • Version (Git ref or <boost/version.hpp>): 1.79
@sdebionne
Copy link
Contributor

Duplicate of #616. Should be fixed in 1.80, what version are you using?

@aleck099
Copy link
Author

1.79

@mloskot
Copy link
Member

mloskot commented Aug 25, 2022

@aleck099 Please, upgrade to 1.80 release or use the current master branch, the fix landed in both c9b339e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants