-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Valid code fails with "reference to local variable declared in enclosing function" #140632
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
Comments
@llvm/issue-subscribers-clang-frontend Author: Gareth Andrew Lloyd (Ignition)
```cpp
#include <array>
#include <ranges>
int main() {
|
These look like duplicates: #140622 If you think there is a difference then we would need a reduction to verify it. |
…out initializer The evaluation context was improperly set up, such that we were trying to setup cleanups for a global var at the point of use, which lead to incorrect diagnostics about the variable not being capturable. Fixes llvm#140632 Fixes llvm#140622
…out initializer The evaluation context was improperly set up, such that we were trying to setup cleanups for a global var at the point of use, which lead to incorrect diagnostics about the variable not being capturable. Fixes llvm#140632 Fixes llvm#140622
@Endilll I think it might be worth it to get a reduction for this, to see if it ends up being a different test case once it is minimal than the other cases. |
Works in GCC 15.1
Error in clang 20.1.0
Works if you remove constexpr
godbolt link
The text was updated successfully, but these errors were encountered: