================
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -std=gnu++20 -emit-llvm %s -o - >/dev/null
+
+int f() { return 1; }
+
+int test0() {
+  using X = int[f()];
+
+  struct S {
+    S() {
+      X x;
----------------
efriedma-quic wrote:

I think we should be rejecting this in Sema; we can't correctly compute the 
size of a variably modified type from within a local class.

Consider a related example:

```
int f(int&);
struct IFace {
  virtual int a() = 0;
  virtual ~IFace();
};
IFace *test() {
  int z = 10;
  using X = int[f(z)];
  struct S : public IFace {
    int a() override { return sizeof(X); }
  };
  return new S;
}
```

How are we supposed to generate code for a() here?

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

Reply via email to