<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - clang-check static analyzer crashes when processing union"
   href="https://llvm.org/bugs/show_bug.cgi?id=31498">31498</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang-check static analyzer crashes when processing union
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>adamf88@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=17792" name="attach_17792" title="Sample program">attachment 17792</a> <a href="attachment.cgi?id=17792&action=edit" title="Sample program">[details]</a></span>
Sample program

Tested on Windows. Llvm build snapshot: 288665

If I run clang-check with command:
clang-check.exe test.cpp -analyze

On the code below:

void* __cdecl memcpy(void* _Dst, void const* _Src, size_t _Size);

struct Test{
    union    {
        char* heapbuf;
        char  stackbuf[8];
    } data;
    unsigned size;

    Test() = default;
    Test(const Test& other)    {
        size = other.size;
        memcpy(data.stackbuf, other.data.stackbuf, size);
        data.stackbuf[size] = 0;
    }
};

Test read(){
    return Test();
}

int main(){
    Test b = read();
    char* data = new char[b.size];
    return 0;
}

Then I receive error message:
Running without flags.
Assertion failed: T::isKind(*this), file
D:\src\llvm_package_288665\llvm\tools\clang\include\clang/StaticAnalyzer/Core/PathSensitive/SVals.h,
line 76
Wrote crash dump file
"C:\Users\AdamF\AppData\Local\Temp\clang-check.exe-016bb1.dmp"
0x01D74378 (0x00000016 0x034600E1 0x00000001 0x02697E2D)
0x03469EE5 (0x03E6FA58 0x03F45652 0x0000004C 0x00000003)
0x0345FF9B (0x03E6FA58 0x03F45652 0x0000004C 0x00C2E2D8)
0x03460183 (0x03E6FA58 0x03F45652 0x0000004C 0x00F668C4)
0x02697E2D (0x00C2E34C 0x00C2E3EC 0x00D25198 0x00F669A8)
0x02697A8B (0x00C2E3EC 0x00C2E46C 0x00C2E468 0x00D25198)
0x0269766D (0x00000002 0x00D37051 0x00000000 0x00F6694C)
0x00D25198 (0x00D37051 0x00000000 0x00F6694C 0x00F66870) <unknown module></pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>