<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/123038>123038</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
missing parenthesis for function-like macro invocation could have better diagnostic
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:diagnostics
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
zmodem
</td>
</tr>
</table>
<pre>
Consider:
```
$ cat /tmp/a.c
#define FOO() 42
int x = FOO;
```
The compiler will error because we forgot to use parens for `FOO`:
```
$ clang -c /tmp/a.c
/tmp/a.c:2:9: error: use of undeclared identifier 'FOO'
2 | int x = FOO;
| ^
1 error generated.
```
It would be nice if the compiler diagnostic included a note pointing out that `FOO` does exist, but as a function-like macro it requires parenthesis.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx0Us1unDAQfhpzGe3Ka--ycOBAkiL1lEtfwNgDTGvsrT1s0j59BdkoaZNaloBvxMx8PyZnGgNiI0534vRQmIWnmJrfc3Q4F310v5r7GDI5TEK3Qm63lLcrW6GOYA2DUB3PF6E6s7cbrB0OFBC6x0ehKqFqOCohWwoMzyD0w1bQd_-2k-23CcHG-UIeEzyR94ApxQQ9WrNkhCeEIaYxMnCEFbiYhCGvIIhSrm1L-f9dvQkj7OzHhd996lYJ3dZCty-z15d1UhxgCQ6tNwkdkMPANBAmEOq88TwL2QIAKBDne_iEK2xnLb4ecfoiZHu4kRwxYDKMbv9RmK8MT3HxDnqEQBaBBuD3YjkyY4iZyQIF6xeHDgyEyAiXSIEpjBAXBp5Ww16lAhcxAz5TZqHuoV8YTAYDwxIsUww7Tz8QZmNTBGJI-HOhhPlFdp4wU94XrtGu1rUpsDmcdVnrsjzXxdSYSiL2fVnpSh7LsjoOg0aly0oaWcneFtQoqU7ycDgdpDrqen_CoTqXysh66PW5t-IocTbk995f531MY0E5L9gclJa6Krzp0ectvUpt5grdvgmRhVJrrFOz_r7rlzGLo_SUOb81ZGKPzUw5rwq947Vl6lMdwjVas6JgN0smc0XokfkvG4ol-WZivuQ1j6oTqhuJp6Xf2zgL1a0b3B67S4rf0bJQ3cYvC9XdKF4b9ScAAP__soAhbA">