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

[Clang][regression] Clang crashes when type of function parameter pack of inner lambda is decltype(outer_lambda_function_parameter_pack) and inner lambda has requires clause #123441

Open
zwuis opened this issue Jan 18, 2025 · 2 comments
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" concepts C++20 concepts confirmed Verified by a second party crash Prefer [crash-on-valid] or [crash-on-invalid] lambda C++11 lambda expressions

Comments

@zwuis
Copy link
Contributor

zwuis commented Jan 18, 2025

This code makes Clang 16 and newer versions crash:

void test() {
  auto L = [](auto... x) {
    return [](decltype(x)... y) requires true {};
  };
  L(0, 1)(1, 2);
}

Compiler Explorer: https://godbolt.org/z/831x11eEr

@llvmbot llvmbot added the clang Clang issues not falling into any other category label Jan 18, 2025
@EugeneZelenko EugeneZelenko added clang:frontend Language frontend issues, e.g. anything involving "Sema" concepts C++20 concepts confirmed Verified by a second party crash Prefer [crash-on-valid] or [crash-on-invalid] lambda C++11 lambda expressions and removed clang Clang issues not falling into any other category labels Jan 18, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 18, 2025

@llvm/issue-subscribers-clang-frontend

Author: Yanzuo Liu (zwuis)

This code makes Clang 16 and newer versions crash:
void test() {
  auto L = [](auto... x) {
    return [](decltype(x)... y) requires true {};
  };
  L(0, 1)(1, 2);
}

Compiler Explorer: <https://godbolt.org/z/831x11eEr>

@zyn0217
Copy link
Contributor

zyn0217 commented Jan 18, 2025

SetupConstraintScope is not handling nested lambdas very well. I think we might want to delegate the job to LambdaScopeForCallOperatorInstantiationRAII which handles both captures and parameters dedicatedly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" concepts C++20 concepts confirmed Verified by a second party crash Prefer [crash-on-valid] or [crash-on-invalid] lambda C++11 lambda expressions
Projects
None yet
Development

No branches or pull requests

4 participants