<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/139314>139314</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Typo correction/Recovery Expr causes bad follow-up diagnostic:
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
erichkeane
</td>
</tr>
</table>
<pre>
See:
https://godbolt.org/z/b99E59WxT
```
template<typename T>
struct S {
template<typename U = T>
void getsTypoCorrection(){}
void baz() {
getsTypoCorrectoin();
}
};
```
Diagnoses as:
```
<source>:10:9: error: use of undeclared identifier 'getsTypoCorrectoin'; did you mean 'getsTypoCorrection'?
10 | getsTypoCorrectoin();
| ^~~~~~~~~~~~~~~~~~
| getsTypoCorrection
<source>:7:10: note: 'getsTypoCorrection' declared here
7 | void getsTypoCorrection(){}
| ^
<source>:10:9: error: cannot refer to member 'getsTypoCorrection' in 'S<T>' with '->'
10 | getsTypoCorrectoin();
| ^
<source>:7:10: note: member 'getsTypoCorrection' declared here
7 | void getsTypoCorrection(){}
```
The first diagnostic is correct, but the 2nd is super weird/awkward. I'm guessing we're not doing a good job checking to make sure the `this` isn't implicit? Or not setting it right?
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMVMGOozgQ_ZriUurI2CGEAwc6CdKeVtru1Z4NLsDTgJFtOpM57LevTJKe7p7MdqxIAfu56tV7RUnndDsS5ZA8QrKP5Ow7Y3Oyuu5eSI4UVUad8iciEAWwovN-cuGRl8DL1qjK9H5lbAu8_AG8rLLskGT_fH8GFuCwYZcfKzwNUy89gdj500SjHAifQRyAFc7bufb4hJA-AisQEW-h_0YQ--udAHo1WmFL3j2fJrMz1lLttRmBb4FnIVa6P_N4A1fyx_n0XaqwPgUx-hpELKhLoHR_fn9fFrBir2U7GkcOpTvL9AEgds7MtqbAWxQxA1FkIAoka40ND7MjNA3Oo6K6l5YUakWj140mi8DTW-RSEI-otMKTmXEgOd4ALlKkIMpzoTFDSHdflbqsgLsuSA7_fl4fgDey_lJ1eq0cRxNMLX5LF99E6MjSJVH6xug-y3-Sg-Rwlwe1HEfj0VJDFr3BgYbqpvoXlnoR_AnEbulHnuJR-y7sPZzfP2h-Z5v9P-tfNfyK5O-lvPPL-djnzx1ho63zqM4d73WN2mF9vg98h9Xs0XeEfFThxM0TWTyStgp4KY8vR2nVCvEP4OmA7UzO6bHFIwFPLYW6UJmwI7E1RuE3U2HdUf0S9oIr8oXQzZaWJLBhvtMONgy1CwV71MPU61p7ECXin3aJ6Mj7cF97tLrtwlmkcqEykcmI8jhdb7ZxmmVJ1OXxRtbbeJM0Sd3EWSXSmCVxtk4227gRYisjnXPGE5awLM5iEa9XckONSJVgdUU8yxisGQ1S96u-fx3CZIy0czPlschEvI56WVHvlnHL-UhHXE6B8zB9bR4uPVRz62DNeu28-xnGa99THvy6Cr4YVv5FtXkle8LD98liLecwiCqpsDF9b44P8_TOLhBFNNs-_zTHte_malWbAXgZEl7-HiZrvi3OlgtNB7y81PGa8_8CAAD__96K5so">