Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
JohelEGP opened this issue Oct 11, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@JohelEGP
Copy link
Contributor

JohelEGP commented Oct 11, 2024

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:

@gregmarr
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants