<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63462>63462</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Expression end location not working in macros
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
abrachet
</td>
</tr>
</table>
<pre>
```
#define MACRO(var) {var}
char ok(int a) {
return {a}; // static_cast<char>( )
}
char macro(int a) {
return MACRO(a); // static_cast<char>(
// note the lack of end `)`
}
```
This fixit is issued here https://github.com/llvm/llvm-project/blob/7175d6a5966af4370ae15fa0b56db1c6c0a7aebe/clang/lib/Sema/SemaInit.cpp#L10366
and uses `FixItHint::CreateInsertion(S.getLocForEndOfToken(PostInit->getEndLoc()), ")");` to emit the insertion for the end paren. It is just missing in the fixit hint.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU1Fv2ywU_TX4BdVywGDz4Ic0ifVF6qdOa9-na3xt0zgQAW67fz_hpKsmTdomIYOu773n3HMAQjCjRWyIuCdin8ESJ-cb6DzoCWPWuf57Q2RxW8WeFFvCeI-DsUj_3-6-PhJWv4InTFFS3adTtb_lrV89gafuRFhtbKRwy7v-o5RSj3HxNsUgVfJ7SlhLWEtDhGj0Nw0hEr5LbQg_EFZTwtQN4DdIZ9De_Qnsg3dK-AvEz_pbonURaZyQzqBP1A0UbU-TPkx9qvST3K_qPU8m0MG8m0hNoCaEBXs6oUc6xXgJhG-vIKOJ09Ll2p0Ja-f59WO7u3j3gjoS1naz6whrq00leglCSQlDyasCcCMGKDoh-26jpS6gAuyQsFbPYMfUyKTCJzzDbTtaE3N9uRDGHzYFl_JKFmxPl4AhDdea92P8z9iYKPLtziNEPNqAPhpnCauf8hHjg9Ot8wfbPw7P7oQp_sWFmPrfEX4YMR5s_-B0kpWpde0oYWw9sasfRBY0OopnE1eVzQcIHZxfI0nvC3i0OT2uOr4sIdKzCcHYkRq7Jl1FnoyNedY3vFdcQYbNRtZVqUohRTY1qhI1dJIPvVSdLAZVaVEDV6LfMFFrnZmGFYwXkvGiZIqJXAnRYzd0AApVVXakLPAMZs6TObnzY7Z62kheSpbN0OEc1tfFmMW3q-FpUrHPfLMa2i1jIGUxmxDDZ5do4ozN4f3iMYQ0e5p5dhpWIayL9M35023c9daHbPFz88-3aGUUCGtXxj8CAAD__2G7OcI">