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

    <tr>
        <th>Summary</th>
        <td>
            Clang frontend C++ crash when __builtin_dump_struct is used on pointer to undefined type
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

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

```C++
#include <stdio.h>

struct Undefined;

struct Defined {
    Undefined* undef;
};

int main() {
    Undefined* value = nullptr;

 __builtin_dump_struct(value, printf);
    return 0;
}
```
Compiling this program crashes the clang frontend. Replacing the type of `value` with `Defined` emits correct code.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8U82OnDwQfBpzae3INAMMBw67Mx_nT1FyyGlkcAOOjI3s9q42Tx8xjLI_WkWyQO5SFeWirGI0kyNqRfkkykumEs8-tAs5thR01nv92s7MaxTFo8BOYDd53XvLBx8mgd1vgd34M1bjGP7_LuRFyMf7s5L7Ogt82tY-xcK4wSZNIIpzZG38YRbFf--ZkUMaGH44TaNxpEXx9AV82UEQ9R0FgHccfIS0bd7I9eWTkHEMizJO4Elg8w-hZ2XT5vcCLlm7cvgkBNdrn4xl4646Let1dyjwdCMKPMMajONRYPOXuX0kEKfgQH7w-DG8fXv2y2qscRPwbCKswU9BLTAEFWeKwDPBYJWbYAzeMTl9gG-0WjXsFAJ-XQn8CKKSu6dKwovheRvcg9xGtBiOMPgQaGAYvKZDpttCN0WjMmrz6lTX8tTUp2xuc12OQ5E3ZSnLCo-YV_qkc0SV12NdkcpMixILWWGZVxLL-pA3fdkcm7we1ek46F4cJS3K2IO1z8tWp8zEmKitilJWmVU92XjrJaKjF7iBAnGraWg3zkOfpiiO0prI8U2FDVtqzx8CgXsL98zgZSb39V8DEyFF0uAdrN44pgDs9y7d-rZFmaVgP98Kw3PqD4NfBHablfvrYQ3-F21t6G4HiAK72wH_BAAA__9kjBH8">