-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
[Regression] clang 18 crashes at clang::Sema::tryCaptureVariable
: Assertion idx < size()
failed
#93828
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]
Comments
github-actions
bot
added
the
clang
Clang issues not falling into any other category
label
May 30, 2024
EugeneZelenko
added
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]
and removed
clang
Clang issues not falling into any other category
labels
May 30, 2024
@llvm/issue-subscribers-clang-frontend Author: LoveSy (yujincheng08)
### Min repro
Godbolt Link https://godbolt.org/z/5EWeoefbM
Additional notes
Stack dump
|
yujincheng08
changed the title
[Regression] clang 18 crashes at
[Regression] clang 18 crashes at May 30, 2024
clang::Sema::tryCaptureVariable
clang::Sema::tryCaptureVariable
: Assertion
idx < size()' failed`
yujincheng08
changed the title
[Regression] clang 18 crashes at
[Regression] clang 18 crashes at May 30, 2024
clang::Sema::tryCaptureVariable
: Assertion
idx < size()' failed`clang::Sema::tryCaptureVariable
: Assertion `idx < size()' failed
yujincheng08
changed the title
[Regression] clang 18 crashes at
[Regression] clang 18 crashes at May 30, 2024
clang::Sema::tryCaptureVariable
: Assertion `idx < size()' failedclang::Sema::tryCaptureVariable
: Assertion idx < size()
failed
Tested locally and this can be fixed by #93206 |
So the key to the fix is to skip past RequiresExpr bodies because they don't form function scopes; our algorithm in the traversal assumes that the VarDecl being captured is at least defined in one of the DCs we're visiting. |
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]
Min repro
Godbolt Link https://godbolt.org/z/5EWeoefbM
Additional notes
b
must have at least one argument, and cannot haveauto
return type.x
's parameter must be a lambda.x
's constraints must contain its parameterv
.Stack dump
The text was updated successfully, but these errors were encountered: