-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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] Trunk crashes on trying to indexing an empty pack inside a lambda #92230
Labels
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
confirmed
Verified by a second party
crash
Prefer [crash-on-valid] or [crash-on-invalid]
lambda
C++11 lambda expressions
Comments
github-actions
bot
added
the
clang
Clang issues not falling into any other category
label
May 15, 2024
RungeCC
changed the title
[clang] Trunk crash on trying to indexing an empty pack inside a lambda
[clang] Trunk crashes on trying to indexing an empty pack inside a lambda
May 15, 2024
zyn0217
added
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
lambda
C++11 lambda expressions
crash
Prefer [crash-on-valid] or [crash-on-invalid]
labels
May 15, 2024
@llvm/issue-subscribers-clang-frontend Author: Runge (RungeCC)
[Minimal example](https://godbolt.org/z/orbo4nj3z).
void ICE(auto...args){
[&]<int idx>(){
using R = decltype( args...[idx] ) ;
}.template operator()<0>();
}
int main( ) {
ICE(); // empty pack
} Crash report:
|
Crashes with |
zyn0217
added a commit
to zyn0217/llvm-project
that referenced
this issue
May 16, 2024
We previously doubled the id-expression expansion, even when the pack was expanded to empty. The previous condition for determining whether we should expand couldn't distinguish between cases where 'the expansion was previously postponed' and 'the expansion occurred but resulted in emptiness.' In the latter scenario, we crash because we have not been examining the current lambda's parent local instantiation scope since D98068: Any Decls instantiated in the parent scope are not visible to the generic lambda. And thus any attempt of looking for instantiated Decls in the lambda is capped to the current Lambda's LIS. Fixes llvm#92230
zyn0217
added a commit
that referenced
this issue
May 21, 2024
…rs (#92385) We previously doubled the id-expression expansion, even when the pack was expanded to empty. The previous condition for determining whether we should expand couldn't distinguish between cases where 'the expansion was previously postponed' and 'the expansion occurred but resulted in emptiness.' In the latter scenario, we crash because we have not been examining the current lambda's parent local instantiation scope since [D98068](https://reviews.llvm.org/D98068): Any Decls instantiated in the parent scope are not visible to the generic lambda, and thus any attempt of looking for instantiated Decls in the lambda is capped to the current Lambda's LIS. Fixes #92230
VyacheslavLevytskyy
pushed a commit
to VyacheslavLevytskyy/llvm-project
that referenced
this issue
May 22, 2024
…rs (llvm#92385) We previously doubled the id-expression expansion, even when the pack was expanded to empty. The previous condition for determining whether we should expand couldn't distinguish between cases where 'the expansion was previously postponed' and 'the expansion occurred but resulted in emptiness.' In the latter scenario, we crash because we have not been examining the current lambda's parent local instantiation scope since [D98068](https://reviews.llvm.org/D98068): Any Decls instantiated in the parent scope are not visible to the generic lambda, and thus any attempt of looking for instantiated Decls in the lambda is capped to the current Lambda's LIS. Fixes llvm#92230
jameshu15869
pushed a commit
to jameshu15869/llvm-project
that referenced
this issue
May 31, 2024
…rs (llvm#92385) We previously doubled the id-expression expansion, even when the pack was expanded to empty. The previous condition for determining whether we should expand couldn't distinguish between cases where 'the expansion was previously postponed' and 'the expansion occurred but resulted in emptiness.' In the latter scenario, we crash because we have not been examining the current lambda's parent local instantiation scope since [D98068](https://reviews.llvm.org/D98068): Any Decls instantiated in the parent scope are not visible to the generic lambda, and thus any attempt of looking for instantiated Decls in the lambda is capped to the current Lambda's LIS. Fixes llvm#92230
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"
confirmed
Verified by a second party
crash
Prefer [crash-on-valid] or [crash-on-invalid]
lambda
C++11 lambda expressions
Minimal example.
-std=c++26
Assertion:
Backtrace:
The text was updated successfully, but these errors were encountered: