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

    <tr>
        <th>Summary</th>
        <td>
            [clang static analyzer] core.NullDereference false negative after endl
        </td>
    </tr>

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

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

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

<pre>
    ```
#include <iostream>

static void before_endl()
{
        int* before_endl = nullptr;
        *before_endl = 0;

        std::cout << std::endl;
}

static void after_endl()
{
        std::cout << std::endl;

        int* after_endl = nullptr;
        *after_endl = 0;
}

int main()
{
    after_endl();
 before_endl();
}
```


See it: https://godbolt.org/z/TY3z6nYqs

In this case, there is no [core.NullDereference] warning for `*after_endl = 0;`

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU81u2zwQfJrVZRGDWsr6OejgxJ-A79JLe8mpoKSVxJYmU5JykTx9IVeJDccJUECgAHJmd2Z_VAh6tMw1bO9hu0_UHCfn659zN812PIQhJq3rn2vIxfqJPYgdkNS2M3PPCPJBuxA9qwPI_9bn0xmiirrDo9M9tjw4z9_Z9gaoBKpWYHH_yqi0jUC7SySC3KOdjXmKHuQZCbS7RomL9xUVYg9yB3LXuTkuMkE-4NvlSckbp9h_JFwNkf2nuv8lz5XXc_BPrF6BxEeqtY14UNre1ImI7628BrrRnfc5rgbg4vzKjDqC3OEU41NYfFMD1Iyub52JG-dHoOYFqPn2KF9y-_grXNL_txgnHbBTgYEeME7sGXVA6xC2953zvPkyG7NnzwN7th3Ddo-_lbfajjg4j4us24V61Zv0tewrWamE67QgmW-rVGTJVAsqtl0nuJCqb9M8K2WVlmlKJQ1tkbdFomsSlIkyzZb7LNtwkZapykXfFlzmVEEm-KC02RhzPCxmEx3CzHUqsjStEqNaNuG0X0SdUXYEomXVfL0Q7tp5DJAJo0MM5xBRR3NayhMD14lUVpnnF_aL_1t1wUGZwGh5VFEf-W_HcalIMntTX7VHx2luN507ADVL4vV39-TdD-4iUHMyEoCa1cuxpj8BAAD__xlMN1M">