[clang] [clang][Interp] IndirectMember initializers (PR #69900)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 16 08:44:31 PST 2024


Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/69900 at github.com>


================
@@ -198,6 +198,26 @@ bool ByteCodeStmtGen<Emitter>::visitFunc(const FunctionDecl *F) {
           return false;
         if (!this->emitInitPtrPop(InitExpr))
           return false;
+      } else if (const IndirectFieldDecl *IFD = Init->getIndirectMember()) {
+        assert(IFD->getChainingSize() >= 2);
+
+        unsigned NestedFieldOffset = 0;
+        const Record::Field *NestedField = nullptr;
+        for (const NamedDecl *ND : IFD->chain()) {
+          const FieldDecl *FD = cast<FieldDecl>(ND);
----------------
AaronBallman wrote:

```suggestion
          const auto *FD = cast<FieldDecl>(ND);
```

https://github.com/llvm/llvm-project/pull/69900


More information about the cfe-commits mailing list