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

    <tr>
        <th>Summary</th>
        <td>
            [Clang] Incomplete/incorrect code completion about explicit object member function
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

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

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

<pre>
    Godbolt: <https://godbolt.org/z/EPaebdEx9>

```cpp
struct S {
  void foo1() const;
  void foo2();
  void foo3(this const S& self);
  void foo4(this S& self);
};

void S::foo1() const {
  this-> // #1
}

void S::foo2() {
  this-> // #2
}

void S::foo3(this const S& self) {
  self. // #3
}

void S::foo4(this S& self) {
  self. // #4
}

void test1(S s) {
  s. // #5
}

void test2(const S s) {
  s. // #6
}
```

Code completion results:

At `#1`, `#3` and `#6`: (missing `foo3`)
```txt
COMPLETION: foo1 : [#void#]foo1()[# const#]
COMPLETION: S : S::
```

---

At `#2`, `#4` and `#5`: (unexpected argument in `foo3` and `foo4`)
```txt
COMPLETION: foo1 : [#void#]foo1()[# const#]
COMPLETION: foo2 : [#void#]foo2()
COMPLETION: foo3 : [#void#]foo3(<#const S &self#>)
COMPLETION: foo4 : [#void#]foo4(<#S &self#>)
COMPLETION: operator= : [#S &#]operator=(<#const S &#>)
COMPLETION: operator= : [#S &#]operator=(<#S &&#>)
COMPLETION: S : S::
COMPLETION: ~S : [#void#]~S()
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8lc2OgzYQx59muFiJnDGQcODA5qNaqe2ulL4AGCdxBRhhs033sM9eDZDNF8n2UFVCcsjM_Oz_-I-dWqv3lVIxBC8QrLy0dQfTxJ9_tdp6mcn_jn8xeWYKByJhIJYH52oLIgHcAG72fWxqmj3g5hNws35PVZavjxGINfCEnpD3j6xr4Il1TSsd2zKYv1B0iZBw9mF0znbGzAAXgBGTprIOxEgG9hmjMQG4cAdt-3K2BQyZVcXuUb5_yh_JnK-GHzzp0rckWiS3a7yWQbAJiDXr28MAxWyAjZEGLT8y8AnjieZrLv05vYCKJ9DRxjzH-Xc4p6yjXm2Zva--LA1GS6k5g6afAOEZcDJbD1uaXDFpyrpQTpuKNcq2hev828UTxyiXdomG5fAmIOQsrfLhNaSB7I-LUlurqz0Fut5TPLqc1x0dzfv22_uv6z9e336nOvIM6wDBC6AghYACgtXZTH1ksH0Xu6NsO8SwR_dSJ5PJjSa80uRfawrOmtpKHWslncpZ2uzbUlWO6epC4qmsM8b_qJi-kEeU0zEwUiMe1dCnAmIJKE6-Agx7cws6rsZx_iOc_437FyBTqyZ1pgGxuuB1hT3wImFsmf8xeQg_wd7a7Tr6tR3tytf2e1u-_eHlscgjEaWeimdznPNwwUXkHeJFzv00iCTOhUp5zuehn_u7IIxUFAbRDj0dI0efRyh4wOezaDqTfJaGWbTwfRH6MgSfqzLVxbQoPkq6hDxtbaviGY9CvvCKNFOF7W42RFmk1R4Q6ZJrYiqYZO3egs8LbZ09I5x2RXcdLruKYMVeq-EIUYAbXUnTNEo6Jm8OlzQzrWPqWBdaasdM9idllarMVMN2bSUpy2ubIr65RLU7tNlUmhJwQ8sYhkndGELQpCTLAm4GZR8x_hMAAP__2nYPZQ">