Files
clang-p2996/clang/lib/Sema/ScopeInfo.cpp
Chuanqi Xu 2ee2b6aa7a [Coroutines] Clear FirstVLALoc in time
Unlike other *Loc member in FunctionScopeInfo, we didn't clear
FirstVLALoc in 'FunctionScopeInfo::Clear()'. Then it will be
problematic for the following case:

```
void bar(int n) {
  int array[n];
  return;
}

coroutine foo(int n) {
  co_return;
}
```

When we parse `foo`, the FirstVLALoc is still valid, then the compiler
will report `vla in coroutine` error in bar, which is super odd. After
this patch, we can fix this.
2024-06-26 13:25:06 +08:00

8.4 KiB