<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/140057>140057</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Unexpected error when passing a type to an unidentified preprocessor definition
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Anthony-Nicholls
</td>
</tr>
</table>
<pre>
Given the following code...
```cpp
class T{};
void f()
{
UNDEFINED_MACRO (T);
}
```
https://godbolt.org/z/5WjGM4KE6
we might expect an error regarding the undeclared identifier `UNDEFINED_MACRO` however, in this specific case we get `'T' does not refer to a value`.
If we change the code to so that it passes a variable instead of a type, for example...
```cpp
void f()
{
int i;
UNDEFINED_MACRO (i);
}
```
https://godbolt.org/z/YT1GGPG4Y
then the error is the more expected `use of undeclared identifier 'UNDEFINED_MACRO'`.
gcc and MSVC both appear to error as we might expect in this scenario.
I've tested this using trunk on CompilerExplorer as linked above.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyklE9v4zYQxT8NdRlEkKh_8UEHJ46NoEhatNkWeyoociTNhiYFkpKTfvqCkpEWAXJaQIBheobz5v2eJbynwSC2rLpj1SERcxita_cmjNa83zyTHK3WPumsem9PtKCBMCL0Vmt7ITOAtArTNGXZPj51tj1ymli2l1p4Dy-suWPNgRV3W9FiSUHP-C3ju3jSxHMAgG_Ph4fj4_PD4e-n_f3vvwLjty-xZmtsDv8fwLL9GMLkWbFn_Mj4cbCqszqk1g2MH_9h_Fj99eP0VP7yUG9jLwhnGsYA-DahDCAMoHPWgcNBOBV3iZvNRqHUwqECUmgC9YQOWJ19UsfqDEZ7wQUd4_dA0Rfy4CeU1JMEKTzCBWHAELsZb14Yb0BZ9GBsAIc9OggWBCxCz8jqLIVN6WMfG-UozICrpuhxLPUWwigCUIBJeI9-bXYkOo1AxgcUCmwPAsL7hFFWbx3gmzhP-ktIX-IgE4A287-gQz9B5_tLfjr9diq_b6LCeE3WxoT8-uVsHV55oYo2zh7jgl9A4s1nSLyJvm4jBilBGAVPf_x5D50NI4hpQrFC2KYKD59T8sFVohGO7PWuR8abBSGgj8LWitmvEXKzeQVr4N6eJ9LoHt4mbR2ul2syr6hAdHbBNFFtoXbFTiTY5k3ZFHlVNVUytlVf8aqo8k5lZVln9W1WS8H7235X7uoKeUItz3iVVXmVF7zOq1R2Rb6Tu1r0WJRFuWNlhmdBOtV6OUfPE_J-xjYvs6xqEi061H79x3Nu8ALrr4zz-AJwbWy66ebBszLT5IP_75pAQWP7zXwg2Xy7RHgxkdGBLXxrsg3M5oOPgsnh5KxE760DhT0ZCmRNMjvdfooLhXHuUmnPjB_j9OvHzeTsD5SB8eOq2TN-vC61tPzfAAAA__-1m4C5">