This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/67411] New: [5/6 Regression] internal compiler error: in tsubst_copy, at cp/pt.c:13473


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

            Bug ID: 67411
           Summary: [5/6 Regression] internal compiler error: in
                    tsubst_copy, at cp/pt.c:13473
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

#include <tuple>

template<typename functor_type>
void invoke_lambda(functor_type &&functor)
{
  functor();
}

template<typename functor_type, typename arg_type>
void invoke_lambda(arg_type &&arg, functor_type &&functor)
{
  functor(std::forward<arg_type>(arg));
}

class conn;

class ts {
public:
  int timestamp;
};

void bar(conn *c, int timestamp)
{
}

void foo(conn *c, ts *t)
{
  invoke_lambda([tuple_conn=std::make_tuple(c), timestamp=t->timestamp] {
    invoke_lambda(tuple_conn, [&] (const auto &tuple_conn) {
      invoke_lambda([=] { bar(std::get<0>(tuple_conn), timestamp); }); }); });
}

With 5/trunk I get:

t.C: In instantiation of âfoo(conn*, ts*)::<lambda()>::<lambda(const
auto:1&)>::<lambda()> [with auto:1 = std::tuple<conn*>]â:
t.C:30:43:   required from âstruct foo(conn*, ts*)::<lambda()>::<lambda(const
auto:1&)> [with auto:1 = std::tuple<conn*>]::<lambda()>â
t.C:30:20:   required from âfoo(conn*, ts*)::<lambda()>::<lambda(const
auto:1&)> [with auto:1 = std::tuple<conn*>]â
t.C:12:10:   required from âvoid invoke_lambda(arg_type&&, functor_type&&)
[with functor_type = foo(conn*, ts*)::<lambda()>::<lambda(const auto:1&)>;
arg_type = const std::tuple<conn*>&]â
t.C:30:73:   required from here
t.C:28:73: internal compiler error: in tsubst_copy, at cp/pt.c:13473
   invoke_lambda([tuple_conn=std::make_tuple(c), timestamp=t->timestamp] {
                                                                         ^
0x6480d4 tsubst_copy
        /home/marek/src/gcc/gcc/cp/pt.c:13473
0x649542 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        /home/marek/src/gcc/gcc/cp/pt.c:16225
0x64afd3 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        /home/marek/src/gcc/gcc/cp/pt.c:15250
0x64a294 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        /home/marek/src/gcc/gcc/cp/pt.c:16006
0x63c490 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/marek/src/gcc/gcc/cp/pt.c:15031
0x643ab9 tsubst_decl
        /home/marek/src/gcc/gcc/cp/pt.c:11958
0x6472ce tsubst_copy
        /home/marek/src/gcc/gcc/cp/pt.c:13604
0x649542 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        /home/marek/src/gcc/gcc/cp/pt.c:16225
0x64b1d7 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        /home/marek/src/gcc/gcc/cp/pt.c:15715
0x63c490 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/marek/src/gcc/gcc/cp/pt.c:15031
0x63ce72 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/marek/src/gcc/gcc/cp/pt.c:14442
0x63bc6b tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/marek/src/gcc/gcc/cp/pt.c:14614
0x63b993 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/marek/src/gcc/gcc/cp/pt.c:14428
0x63bc6b tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/marek/src/gcc/gcc/cp/pt.c:14614
0x639f45 instantiate_decl(tree_node*, int, bool)
        /home/marek/src/gcc/gcc/cp/pt.c:21158
0x67b188 instantiate_class_template_1
        /home/marek/src/gcc/gcc/cp/pt.c:10161
0x67b188 instantiate_class_template(tree_node*)
        /home/marek/src/gcc/gcc/cp/pt.c:10229
0x71aebb complete_type(tree_node*)
        /home/marek/src/gcc/gcc/cp/typeck.c:138
0x64aa0d tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        /home/marek/src/gcc/gcc/cp/pt.c:16345
0x64b1d7 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        /home/marek/src/gcc/gcc/cp/pt.c:15715
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]