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

    <tr>
        <th>Summary</th>
        <td>
            Diagnostic suppressed when bad code in macro
        </td>
    </tr>

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

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

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

<pre>
    https://godbolt.org/z/zzMrTzv6a

We're seeing a warning diagnostic (reference cannot be null, so it always evaluates true) from plain code (e.g. line 6 below) but not when the identical code is produced from a macro (line 5).  This seems... wrong.
```
#define TEST(COND) if (COND) goo()
void goo(void);
void test(int &);
void test(int &a) {
  TEST(&a);
  if (&a) goo();
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEk0-PmzAQxT_NcBktgiEEOHDY3TS3todG6tnYA3Hl2Mg2iXY_feXANqu9VOKP7Zn3eCP9ECHoyTL3UL9AfcjEEs_O97ObXN1lg1Nv_TnGOUD1DHQEOk5ODc7E3PkJ6Pie7vfv_vR-3QsoDlA8r8_fDNR4xsCs7YQCb8LbtFJaTNaFqCUCtZ5H9mwloxTWuogDo12MAXrF4FBHFOYm3gLyVZhFRA4Y_cJAHY7eXXA2QluUTnFy43zK0WjLuMeBjbulvmGJmJxvZ7YYz4xasY1aCrPqdMDZO7VIVqunwIuQ3iXDu1cN1OWIp7MOaZxLyPMcb97ZKd8m3hfbtW6pUjwm5enbrxNQ-_rzxyEl0SN-2k3OAbVA3aq6Oq22s7RM59XLp1LkEIFabSMC7f9TFukD0GwN-BFkq_xT4hbpQ_GI9NEBzeHLjJnqK9VVnci4L5uiqNu2qcvs3BdSybbkdpBVsSvauhTNWMldy8246yolMt1TQVVZUlk2u7ouc67rvSyauhxp3437EnYFX4Q2uTHXSwIs0yEs3DdVQZQZMbAJd06JpBF2gur5QVMAogSw75P6aVimALvC6BDDwy_qaLg_PBAMyzx7DoHVyscg1EaFXSnIFm--_gE6npchl-4CdEzW2-tp9u4Pywh0vOcOQMd79L8BAAD__z_NB4E">