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

    <tr>
        <th>Summary</th>
        <td>
            Argument mismatch diagnostics points to end of (static) member call
        </td>
    </tr>

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

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

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

<pre>
    Consider this example:
```c++
class Foo {
public:
  static int bar(int a, int b){ return 1; }

  int mbar(int a, int b) { return 1; }
};

int c = Foo::bar(
    0);

int d = Foo().mbar(
    0);

int bar2(int a, int b) { return 1;}

int e = bar2(
 0);
```
https://godbolt.org/z/5cne1c15P

The output is:
```console
<source>:9:6: error: too few arguments to function call, expected 2, have 1
    8 | int c = Foo::bar(
      |         ~~~~~~~~
 9 |     0);
      |      ^
<source>:3:14: note: 'bar' declared here
    3 |   static int bar(int a, int b){ return 1; }
      |              ^ ~~~~~~~~~~~~
<source>:12:6: error: too few arguments to function call, expected 2, have 1
   11 | int d = Foo().mbar(
      |         ~~~~~~~~~~
 12 |     0);
      |      ^
<source>:5:7: note: 'mbar' declared here
 5 |   int mbar(int a, int b) { return 1; }
      |       ^ ~~~~~~~~~~~~
<source>:16:9: error: no matching function for call to 'bar2'
 16 | int e = bar2(
      |         ^~~~
<source>:14:5: note: candidate function not viable: requires 2 arguments, but 1 was provided
   14 | int bar2(int a, int b) { return 1;}
      |     ^    ~~~~~~~~~~~~
3 errors generated.
```

The caret of the two diagnostics pointing to calls of `mbar` or `bar` point to the END of the call, i.e. the closing `)`. For `bar2`, the caret points to the start of the call, which is what I would expect.

This seems weird to me. For the member calls, I'd expect the caret to either point to the start of the LHS of the member expr, or to the beginning of the member call, i.e. directly after the `.`/`::`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyslt2OqzYQx5_GuRmdCJsA4Y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