================
@@ -1360,8 +1360,10 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, 
QualType RetTy,
       else
         Ty = VD->getType();
 
-      if (Ty->isVariablyModifiedType())
+      if (Ty->isVariablyModifiedType()) {
+        RunCleanupsScope Scope(*this);
----------------
a-tarasyuk wrote:

```cpp
typedef struct { x value; } S;
int size(const S *);
int f(int a[size(&(constexpr S){ 0 })]) { return a[0]; }
```

My understanding is that the compound literal should remain alive until f 
returns. `RunCleanupsScope` transfers its cleanup to the function's cleanup 
scope rather than running it immediately. Is there a better way to handle this?



https://github.com/llvm/llvm-project/pull/212559
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to