type: introduce get_final_type()
[smatch.git] / validation / constexpr-cast.c
blob27069614c273d28fd7a12a8c95ac3edaa7059a98
1 static int a[] = {
2 [(int)0] = 0, // OK
3 [(int)(int)0] = 0, // OK
4 [(int)0.] = 0, // OK
5 [(int)(int)0.] = 0, // OK
6 [(int)__builtin_choose_expr(0, 0, 0)] = 0, // OK
7 [(int)__builtin_choose_expr(0, 0, 0.)] = 0, // OK
9 [(int)(float)0] = 0, // KO
10 [(int)(float)0.] = 0, // KO
12 [(int)(void*)0] = 0, // KO
13 [(int)(void*)0.] = 0, // KO
17 * check-name: Expression constness propagation in casts
19 * check-error-start
20 constexpr-cast.c:9:11: error: bad integer constant expression
21 constexpr-cast.c:10:11: error: bad integer constant expression
22 constexpr-cast.c:12:11: error: bad integer constant expression
23 constexpr-cast.c:13:11: error: bad integer constant expression
24 * check-error-end