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

--- Comment #1 from Valentine <v at vsamko dot com> ---
Simpler example without any include's:

===
volatile int SIZE = 100;

template<typename T, typename... U>
void bar(T t, U... u) {
    t(u...);
}

template<typename... Ts>
void foo(Ts&... out) {
    char buf[SIZE];
    bar([&buf, &out...](auto&... x) { (x, ...); }, out...);
}

int main() {
    int x1;
    foo(x1);
}
===

results in:

g++ test.cpp -std=c++17 -O0 
during RTL pass: expand
test.cpp: In lambda function:
test.cpp:11:9: internal compiler error: in expand_expr_real_1, at expr.c:10012
   11 |     bar([&buf, &out...](auto&... x) { (x, ...); }, out...);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x79d4d9 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        ../../gcc-9.1.0/gcc/expr.c:10012
0x1236818 expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier,
rtx_def**, bool)
        ../../gcc-9.1.0/gcc/expr.c:8275
0x1236818 expand_expr
        ../../gcc-9.1.0/gcc/expr.h:279
0x1236818 expand_operands(tree_node*, tree_node*, rtx_def*, rtx_def**,
rtx_def**, expand_modifier)
        ../../gcc-9.1.0/gcc/expr.c:7873
0x123082a expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
        ../../gcc-9.1.0/gcc/expr.c:8733
0x115d279 expand_gimple_stmt_1
        ../../gcc-9.1.0/gcc/cfgexpand.c:3789
0x115d279 expand_gimple_stmt
        ../../gcc-9.1.0/gcc/cfgexpand.c:3850
0x11579de expand_gimple_basic_block
        ../../gcc-9.1.0/gcc/cfgexpand.c:5886
0x11579de execute
        ../../gcc-9.1.0/gcc/cfgexpand.c:6509
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.

Reply via email to