<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/120974>120974</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [DebugInfo] DW_AT_object_pointer not emitted for explicit object parameter
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Michael137
      </td>
    </tr>
</table>

<pre>
    Using C++23's `deducing this`:
```
struct Foo {
    void x(this Foo && self) {}
};

int main() { Foo{}.x(); }
```

Neither Clang nor GCC attach a `DW_AT_object_pointer` to the `this` parameter DIE: 
https://godbolt.org/z/h4jeT54G5

We probably should be doing so (LLDB will need to rely on this attribute in the future to distinguish static vs. non-static methods..see https://github.com/llvm/llvm-project/issues/120973).
In the DWARFv5 spec chapter "5.7.8 Member Function Entries" we state:
```
If the member function entry describes a non-static member function, then that
entry has a DW_AT_object_pointer attribute whose value is a reference to the
formal parameter entry that corresponds to the object for which the function is
called. The name attribute of that formal parameter is defined by the current
language (for example, this for C++ or self for Objective C and some other
languages). That parameter also has a DW_AT_artificial attribute whose value is
true.
Conversely, if the member function entry describes a static member function, the
entry does not have a DW_AT_object_pointer attribute.

<non-normative>
In C++, non-static member functions can have const-volatile qualifiers, which affect the
type of the first formal parameter (the “this”-pointer).
</non-normative>
```

Might be worth updating the non-normative text in this section. @dwblaikie @adrian-prantl 
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJykVU1v4zYQ_TXjyyACTfnz4INsx4sAuy1QpNhjQJEja7Y0qZKUHffXF5Sc3WQ32xYoECCWxJl58-bNo4qRj45oA_MtzPcT1afWh80n1q0iOy2Xk9qb6-b3yO6IO5BbkFtZglxGhIUwZHqdv6SWIywElBWIKv8Y_0QVU-h1woP3CMstiAoR8ezZ4DPIVQ4bv8kFyAVGsg3I9XB0uc-plnsocxiIil3Ck2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