-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
Lambda with concept-constrained type parameter in unevaluated context causes crash #70601
Comments
@llvm/issue-subscribers-clang-frontend Author: Janko Dedic (JankoDedic)
Clang 17.0.1 crashes while compiling this example:
```cpp
template <class>
concept C = true;
template <class> U<int> foo();
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
|
It looks like this is a regression from clang-15: https://godbolt.org/z/qfoMvGWvj |
@cor3ntin I want to fix this issue |
Check that the number of non-concept template parameters is greater than zero during lambda template instantiation to aviod panic Fix issue: llvm#70601
…eclaration (#82310) This patch attempts to fix the lambda call expression inside of a type alias declaration from two aspects: 1. Defer the lambda call expression building until after we have sufficient template arguments. This avoids the overeager (and often wrong) semantic checking before the type alias instantiation. 2. Properly obtain template arguments involving a template type alias for constraint checking. It is unfortunate that a `TypeAliasTemplateDecl` (or a `TypeAliasDecl`) is never a `DeclContext`, nor does it have an associated specialization Decl from which we could collect these template arguments. Thus, I added a new CodeSynthesisContext to record template arguments for alias declarations. Fixes #70601 Fixes #76674 Fixes #79555 Fixes #81145 Fixes #82104 Note that this doesn't involve the fix for #28461. That seems different, and I'd like to leave it as a follow-up.
Clang 17.0.1 crashes while compiling this example:
Godbolt link: https://godbolt.org/z/eeYo8e96h
Full error:
The text was updated successfully, but these errors were encountered: