CaseyCarter / cmcstl2

An implementation of C++ Extensions for Ranges
Other
221 stars 68 forks source link

GCC 8.3 and 9.1: Internal compiler error in type_dependent_expression_p, at cp/pt.c:25930 #311

Open mnieper opened 5 years ago

mnieper commented 5 years ago

Running make produces the following error with GCC 8.3 and GCC 9.1 on Ubuntu 19.04:

[ 11%] Building CXX object test/iterator/CMakeFiles/iter.operations.dir/operations.cpp.o
In file included from /home/mnieper/github/cmcstl2/include/stl2/detail/range/concepts.hpp:24,
                 from /home/mnieper/github/cmcstl2/include/stl2/detail/iterator/insert_iterators.hpp:21,
                 from /home/mnieper/github/cmcstl2/include/stl2/iterator.hpp:28,
                 from /home/mnieper/github/cmcstl2/include/stl2/view/iota.hpp:16,
                 from /home/mnieper/github/cmcstl2/test/iterator/operations.cpp:13:
/home/mnieper/github/cmcstl2/include/stl2/detail/range/access.hpp: In substitution of ‘template<class R> using __begin_t = decltype (std::experimental::ranges::v1::__cpos::begin(declval<R>())) [with R = std::experimental::ranges::v1::ext::take_exactly_view<std::experimental::ranges::v1::iota_view<int> >&]’:
/home/mnieper/github/cmcstl2/include/stl2/detail/range/concepts.hpp:42:8:   required by substitution of ‘template<class T> using iterator_t = std::experimental::ranges::v1::__begin_t<R&> [with T = std::experimental::ranges::v1::ext::take_exactly_view<std::experimental::ranges::v1::iota_view<int> >]’
/home/mnieper/github/cmcstl2/include/stl2/detail/range/concepts.hpp:138:28:   required from here
/home/mnieper/github/cmcstl2/include/stl2/detail/range/access.hpp:53:19: internal compiler error: in type_dependent_expression_p, at cp/pt.c:25930
   53 |     { __decay_copy(r.begin()) } -> Iterator;
      |       ~~~~~~~~~~~~^~~~~~~~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-9/README.Bugs> for instructions.
make[2]: *** [test/iterator/CMakeFiles/iter.operations.dir/build.make:63: test/iterator/CMakeFiles/iter.operations.dir/operations.cpp.o] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:1975: test/iterator/CMakeFiles/iter.operations.dir/all] Fehler 2
make: *** [Makefile:141: all] Fehler 2

Of course, this is foremost a bug of GCC (because an ICE shouldn't happen). Nevertheless, I am posting it here for two reasons:

  1. As long as the bug is not fixed in GCC, it would be nice to have a workaround.
  2. It is quite hard for me to construct a minimal example exhibiting the bug, which one can submit to the GCC bugtracker. I am hoping that the cmcstl2 team could provide a much better bug report.
cjdb commented 5 years ago

Thanks for filing this! Apparently there are two independent ICEs: one for GCC 8.3 and a completely different one for GCC 9.

mnieper commented 5 years ago

Would you be able to report the ICE to the GCC team?

jicama commented 4 years ago

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91378