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

    <tr>
        <th>Summary</th>
        <td>
            __attribute__((lifetimebound)) cannot be applied on the implicit "this" parameter
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:memory-safety
      </td>
    </tr>

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

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

<pre>
    See https://godbolt.org/z/KdGEfdG4r

```

struct Foo2 {
  int& get1() [[clang::lifetimebound]];  // good
  int& get2() __attribute__((lifetimebound)); // bad

  const int& get3(const int& a __attribute__((lifetimebound))); // good
};


void s() {
  Foo2 f;
 const int &b = f.get3(1);
}
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMkstupDwQhZ-m2FhpmTLmsvCiW_nJ4l_OA7RsXIBnDEbYRMo8_QiaKJdVpCMhSuirU4ejY3TDTKRA3kA-Z3pLY1jVGP6QmzMT7Jv6RcTGlJYI4grYArZDsCb4dAnrANj-BWz_ty__9falWIFfd5X81PEa07p1ibUhIIPqBvzKmJsTYMkGSjlgDdiww8Gt83oe9k3i6l1PyU1kwjZbkM-7xI2xhwk2hGC_ofBE3e86pdWZLdH9fszqrzBsdonbO8to-7DKWBfmmD4xBWD9ZaZ_iv-y4XQL1X7DmRK_vgZnWXwP4IzmyKl_fPZhhwGWhoF4Zv3ltJU_VpzYT7FnVgnbiEZnpPJKlFhw0YhsVJWsRUGyanht-4ZyLXJZU9GXRY_G5HnmFHKUPOcVr2UjxaU2WpaF6ZpG9qKoOBScJu38xfvXaW9A5mLcSOWYN1xmXhvy8WgT4vu_nGgK69tT1D2lN0Dci7aqHfBktiFCwb2LKX4gk0ue1M9iZp2e55CYIaaXxTuyLMwsjcTctHjXuT05TKOLgMgWveqJEq3Ztnr1rdYujZu5dGECbHcv5-NpWcNv6hJge9waAdvz3FeF_wIAAP__ghb3iw">