brintos

brintos / llvm-project-archived public Read only

0
0
Text · 300 B · 079632d Raw
14 lines · c
1// RUN: %clang_analyze_cc1 -analyzer-checker=core.builtin -verify -Wno-unused -Wno-error=incompatible-pointer-types %s2 3typedef union {4  int y;5} U;6 7typedef struct { int x; } A;8 9void foo(void) {10  U u = {};11  A *a = &u; // expected-warning{{incompatible pointer types}}12  a->x;      // no-crash13}14