[Bug c++/82474] New: [8 Regression] ICE: trying to capture ‘list’ in instantiation of generic lambda
trippels at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Oct 8 08:54:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82474
Bug ID: 82474
Summary: [8 Regression] ICE: trying to capture ‘list’ in
instantiation of generic lambda
Product: gcc
Version: 8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: trippels at gcc dot gnu.org
CC: jason at gcc dot gnu.org
Target Milestone: ---
% cat laws.functor.ii
struct A;
struct B {
template <typename X> void operator()(X) const;
};
template <typename> B make;
template <typename, typename = A> struct TestMonad {
template <typename Xs, typename XXs> TestMonad(Xs, XXs);
};
template <typename S> struct TestMonad<S> : TestMonad<S, int> {
template <typename Xs, typename XXs>
TestMonad(Xs, XXs) : TestMonad<S, int>{0, 0} {
constexpr auto list = make<S>;
[=](auto x) { list(x); }(0);
}
};
int main() { TestMonad<int>{0, 0}; }
% g++ -c laws.functor.ii
laws.functor.ii: In instantiation of ‘TestMonad<S>::TestMonad(Xs, XXs) [with Xs
= int; XXs = int; S = int]::<lambda(auto:1)> [with auto:1 = int]’:
laws.functor.ii:13:29: required from ‘TestMonad<S>::TestMonad(Xs, XXs) [with
Xs = int; XXs = int; S = int]’
laws.functor.ii:16:33: required from here
laws.functor.ii:13:23: internal compiler error: trying to capture ‘list’ in
instantiation of generic lambda
[=](auto x) { list(x); }(0);
~~~~^~~
0x10354b8b add_capture(tree_node*, tree_node*, tree_node*, bool, bool)
../../gcc/gcc/cp/lambda.c:624
0x103550c7 add_default_capture(tree_node*, tree_node*, tree_node*)
../../gcc/gcc/cp/lambda.c:695
0x104a4957 process_outer_var_ref(tree_node*, int, bool)
../../gcc/gcc/cp/semantics.c:3371
0x1033bb93 mark_use
../../gcc/gcc/cp/expr.c:121
0x104fcf3b cp_build_addr_expr_1
../../gcc/gcc/cp/typeck.c:5655
0x10211787 build_this
../../gcc/gcc/cp/call.c:3368
0x102290b7 add_function_candidate
../../gcc/gcc/cp/call.c:2163
0x1022a547 add_template_candidate_real
../../gcc/gcc/cp/call.c:3211
0x1022af97 add_template_candidate
../../gcc/gcc/cp/call.c:3253
0x1022af97 add_candidates
../../gcc/gcc/cp/call.c:5517
0x10232137 build_op_call_1
../../gcc/gcc/cp/call.c:4496
0x10232137 build_op_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, int)
../../gcc/gcc/cp/call.c:4585
0x104a414b finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**,
bool, bool, int)
../../gcc/gcc/cp/semantics.c:2502
0x1042cf53 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
../../gcc/gcc/cp/pt.c:17764
0x1043294b tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:16728
0x1043096b tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:15974
0x104328ff tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:16203
0x104328ff tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:16203
0x104328ff tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:16203
0x10477b93 instantiate_decl(tree_node*, bool, bool)
../../gcc/gcc/cp/pt.c:23262
More information about the Gcc-bugs
mailing list