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

            Bug ID: 102866
           Summary: Unexpected error on variadic forwarding
           Product: gcc
           Version: 11.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: benni.probst at gmx dot de
  Target Milestone: ---

Created attachment 51640
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51640&action=edit
A multi variant data container

I changed a push function to determine between containers that can execute
push_back and those who dont. The original line was just this->data =
this->create(args..., this->data); instead of the compile switch. At this point
the error occurred. The key is line 83 and 101

Sources cannot be uploaded because exe file is 1 Gigabyte in size

====================[ Build | UltiHash | Debug
]================================
/usr/local/bin/cmake --build
/home/benjamin/CLionProjects/UltiHash/cmake-build-debug --target UltiHash -j 8
Scanning dependencies of target UltiHash
[ 11%] Building CXX object CMakeFiles/UltiHash.dir/dataContainer.cpp.o
[ 22%] Building CXX object CMakeFiles/UltiHash.dir/main.cpp.o
In file included from
/home/benjamin/CLionProjects/UltiHash/aiHeuristics_runtime_tests.h:4,
                 from /home/benjamin/CLionProjects/UltiHash/main.cpp:8:
/home/benjamin/CLionProjects/UltiHash/dataContainer.h: In instantiation of
‘dataContainer<unsigned int>::push_back<std::vector<unsigned int,
std::allocator<unsigned int> >&>(std::vector<unsigned
int>&)::<lambda(auto:124)> [with auto:124 = std::integral_constant<long
unsigned int, 0>]’:
/usr/local/include/boost/mp11/detail/mp_with_index.hpp:374:84:   required by
substitution of ‘template<class N, class F> constexpr decltype
(declval<F>()(declval<boost::mp11::mp_size_t<0> >()))
boost::mp11::mp_with_index(std::size_t, F&&) [with N =
std::integral_constant<long unsigned int, 10>; F = dataContainer<unsigned
int>::push_back<std::vector<unsigned int, std::allocator<unsigned int>
>&>(std::vector<unsigned int>&)::<lambda(auto:124)>]’
/home/benjamin/CLionProjects/UltiHash/dataContainer.h:78:79:   required from
‘void dataContainer<T, alloc>::push_back(Args&& ...) [with Args =
{std::vector<unsigned int, std::allocator<unsigned int> >&}; T = unsigned int;
alloc = {}]’
/home/benjamin/CLionProjects/UltiHash/dataContainer.h:1525:17:   required from
‘dataContainer<unsigned int>::benchmark(long unsigned int, long unsigned int,
internEnum, internEnum)::<lambda(auto:202)>::<lambda(auto:203)> [with auto:203
= std::integral_constant<long unsigned int, 0>]’
/usr/local/include/boost/mp11/detail/mp_with_index.hpp:374:84:   required by
substitution of ‘template<class N, class F> constexpr decltype
(declval<F>()(declval<boost::mp11::mp_size_t<0> >()))
boost::mp11::mp_with_index(std::size_t, F&&) [with N =
std::integral_constant<long unsigned int, 10>; F = dataContainer<unsigned
int>::benchmark(long unsigned int, long unsigned int, internEnum,
internEnum)::<lambda(auto:202)>::<lambda(auto:203)>]’
/home/benjamin/CLionProjects/UltiHash/dataContainer.h:1518:83:   required from
‘dataContainer<unsigned int>::benchmark(long unsigned int, long unsigned int,
internEnum, internEnum)::<lambda(auto:202)> [with auto:202 =
std::integral_constant<long unsigned int, 0>]’
/usr/local/include/boost/mp11/detail/mp_with_index.hpp:374:84:   required by
substitution of ‘template<class N, class F> constexpr decltype
(declval<F>()(declval<boost::mp11::mp_size_t<0> >()))
boost::mp11::mp_with_index(std::size_t, F&&) [with N =
std::integral_constant<long unsigned int, 10>; F = dataContainer<unsigned
int>::benchmark(long unsigned int, long unsigned int, internEnum,
internEnum)::<lambda(auto:202)>]’
/home/benjamin/CLionProjects/UltiHash/dataContainer.h:1497:79:   required from
‘void dataContainer<T, alloc>::benchmark(long unsigned int, long unsigned int,
internEnum, internEnum) [with T = unsigned int; alloc = {}; internEnum = long
unsigned int]’
/home/benjamin/CLionProjects/UltiHash/dataContainer.h:1496:10:   required from
here
/home/benjamin/CLionProjects/UltiHash/dataContainer.h:83:55: internal compiler
error: trying to capture ‘args#0’ in instantiation of generic lambda
   83 |                 this->data = this->create(this->data, args...);
      |                                                       ^~~~
0x7c3781 add_capture(tree_node*, tree_node*, tree_node*, bool, bool)
        ../../gcc/cp/lambda.c:619
0x7c37f3 add_default_capture(tree_node*, tree_node*, tree_node*)
        ../../gcc/cp/lambda.c:679
0x87bd81 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/cp/pt.c:20916
0x87a742 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/cp/pt.c:19650
0x87a742 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/cp/pt.c:21031
0x88bd14 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/cp/pt.c:19650
0x88bd14 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:19200
0x88ac3a tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:18176
0x88ac3a gen_elem_of_pack_expansion_instantiation
        ../../gcc/cp/pt.c:12587
0x88ac3a tsubst_pack_expansion(tree_node*, tree_node*, int, tree_node*)
        ../../gcc/cp/pt.c:13250
0x87b517 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/cp/pt.c:20320
0x87b368 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/cp/pt.c:19650
0x87b368 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/cp/pt.c:20127
0x88bd14 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/cp/pt.c:19650
0x88bd14 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:19200
0x88db3b tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:18176
0x88db3b tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:18220
0x88c947 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:18176
0x88c947 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:18549
0x88d99e tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/cp/pt.c:18176
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
make[3]: *** [CMakeFiles/UltiHash.dir/build.make:72:
CMakeFiles/UltiHash.dir/main.cpp.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:83: CMakeFiles/UltiHash.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:90: CMakeFiles/UltiHash.dir/rule] Error 2
make: *** [Makefile:124: UltiHash] Error 2

Reply via email to