cppfront icon indicating copy to clipboard operation
cppfront copied to clipboard

[BUG] Infinite recursion in block parameter named after initializing capture

Open JohelEGP opened this issue 1 year ago • 1 comments

Title: Infinite recursion in block parameter named after initializing capture.

Minimal reproducer (https://cpp2.godbolt.org/z/cKjndzxYn):

main: () = {
  test_overloads := 0;
  _ = :() = {
    (test_overloads := test_overloads$) { }
  };
}
Commands:
cppfront main.cpp2
clang++-18 -std=c++26 -stdlib=libc++ -lc++abi -pedantic-errors -Wall -Wextra -Wconversion -Werror=unused-result -Werror=unused-value -Werror=unused-parameter -Werror=unused-variable -I . main.cpp

Expected result: A working program (-Werror=unused-variable notwithstanding).

Actual result and error:

Output:

Killed - processing time exceeded
Program terminated with signal: SIGKILL
Compiler returned: 143

See also:

  • #880.
  • #1312.

JohelEGP avatar Oct 11 '24 16:10 JohelEGP

I object to this being well-formed for the same reason as #1312. It should however be an error and not an infinite loop. :D

gregmarr avatar Oct 11 '24 21:10 gregmarr