blob: b433e7b0ef629daea1a72f91a48ab593d93616b4 [file] [log] [blame]
Dominic Chen184c6242017-03-03 18:02:02 +00001// RUN: %clang_analyze_cc1 -analyzer-checker=core.builtin -analyzer-store=region -verify -Wno-unused %s
Artem Dergachev22e28f42016-11-22 04:29:23 +00002
3typedef union {
4 int y;
5} U;
6
7typedef struct { int x; } A;
8
9void foo() {
10 U u = {};
11 A *a = &u; // expected-warning{{incompatible pointer types}}
12 a->x; // no-crash
13}