Mercurial > hg > CbC > CbC_llvm
annotate clang/test/Analysis/uninit-vals-union.c @ 222:81f6424ef0e3 llvm-original
LLVM original branch
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 18 Jul 2021 22:10:01 +0900 |
parents | 1d019706d866 |
children | c4bab56944e8 |
rev | line source |
---|---|
150 | 1 // RUN: %clang_analyze_cc1 -analyzer-checker=core.builtin -analyzer-store=region -verify -Wno-unused %s |
2 | |
3 typedef union { | |
4 int y; | |
5 } U; | |
6 | |
7 typedef struct { int x; } A; | |
8 | |
9 void foo() { | |
10 U u = {}; | |
11 A *a = &u; // expected-warning{{incompatible pointer types}} | |
12 a->x; // no-crash | |
13 } |