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

Assertion `CapturedVar->isInitCapture()' failed #110721

Closed
dcb314 opened this issue Oct 1, 2024 · 4 comments · Fixed by #110887
Closed

Assertion `CapturedVar->isInitCapture()' failed #110721

dcb314 opened this issue Oct 1, 2024 · 4 comments · Fixed by #110887
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" concepts C++20 concepts confirmed Verified by a second party crash-on-valid

Comments

@dcb314
Copy link

dcb314 commented Oct 1, 2024

Recent clang says:

clang++: /home/dcb40b/llvm/trunk/clang/lib/Sema/SemaConcept.cpp:719: clang::Sema::addInstantiatedCapturesToScope(clang::FunctionDecl*, const clang::FunctionDecl*, clang::LocalInstantiationScope&, const clang::MultiLevelTemplateArgumentList&)::<lambda(const clang::ValueDecl*, unsigned int)>: Assertion `CapturedVar->isInitCapture()' failed.

connectionencryptiondata_p-e2be0f.sh.gz
connectionencryptiondata_p-e2be0f.cpp.gz

@dcb314 dcb314 added clang Clang issues not falling into any other category concepts C++20 concepts crash-on-valid labels Oct 1, 2024
@EugeneZelenko EugeneZelenko added clang:frontend Language frontend issues, e.g. anything involving "Sema" and removed clang Clang issues not falling into any other category labels Oct 1, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Oct 1, 2024

@llvm/issue-subscribers-clang-frontend

Author: None (dcb314)

Recent clang says:

clang++: /home/dcb40b/llvm/trunk/clang/lib/Sema/SemaConcept.cpp:719: clang::Sema::addInstantiatedCapturesToScope(clang::FunctionDecl*, const clang::FunctionDecl*, clang::LocalInstantiationScope&, const clang::MultiLevelTemplateArgumentList&)::<lambda(const clang::ValueDecl*, unsigned int)>: Assertion `CapturedVar->isInitCapture()' failed.

connectionencryptiondata_p-e2be0f.sh.gz
connectionencryptiondata_p-e2be0f.cpp.gz

@shafik shafik added the needs-reduction Large reproducer that should be reduced into a simpler form label Oct 1, 2024
@zyn0217
Copy link
Contributor

zyn0217 commented Oct 2, 2024

Reduced by me and CReduce:

(The crash only triggers w/ assertion build)

template <int N> void connect() {
  int x = N, y = N;
  [x, y = y]()
    requires requires { x; }
  {}();
}

void foo() {
  connect<42>();
}

https://godbolt.org/z/nqs6x31Gx

@shafik
Copy link
Collaborator

shafik commented Oct 2, 2024

Looks like a regression on trunk: https://godbolt.org/z/h9frKK74Y

CC @cor3ntin

@shafik shafik added confirmed Verified by a second party and removed needs-reduction Large reproducer that should be reduced into a simpler form labels Oct 2, 2024
@dcb314
Copy link
Author

dcb314 commented Oct 2, 2024

Seems to go wrong sometime before or on date 2024-09-03.
Git hash 4d8903b.

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-on-valid
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants