================ @@ -414,8 +414,15 @@ void Environment::initialize() { } } else if (MethodDecl->isImplicitObjectMemberFunction()) { QualType ThisPointeeType = MethodDecl->getFunctionObjectParameterType(); - setThisPointeeStorageLocation( - cast<RecordStorageLocation>(createObject(ThisPointeeType))); + auto &ThisLoc = + cast<RecordStorageLocation>(createStorageLocation(ThisPointeeType)); + setThisPointeeStorageLocation(ThisLoc); + refreshRecordValue(ThisLoc, *this); + // Initialize fields of `*this` with values, but only if we're not + // analyzing a constructor; after all, it's the constructor's job to do ---------------- martinboehme wrote:
Do you mean something like this? ```cxx struct S { S() {} int i = 1; }; ``` If so, the answer is yes: ``` |-CXXConstructorDecl <line:2:5, col:10> col:5 S 'void ()' implicit-inline | |-CXXCtorInitializer Field 0xc1eeb90 'i' 'int' | | `-CXXDefaultInitExpr <col:5> 'int' has rewritten init | | `-IntegerLiteral <line:3:13> 'int' 1 | `-CompoundStmt <line:2:9, col:10> ``` https://godbolt.org/z/oYP66fMjT https://github.com/llvm/llvm-project/pull/84164 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits