1 /* { dg-do compile } */
3 /* C99 6.5.4 Cast operators.
4 Test invalid casts involving decimal float. */
6 struct s
{ _Decimal32 d32
; } sv
;
7 union u
{ _Decimal32 d32
; } uv
;
20 (_Decimal32
[]) d32p
; /* { dg-error "cast specifies array type" } */
21 (_Decimal32 ()) d32p
; /* { dg-error "cast specifies function type" } */
22 (_Decimal64
[]) d64p
; /* { dg-error "cast specifies array type" } */
23 (_Decimal64 ()) d64p
; /* { dg-error "cast specifies function type" } */
24 (_Decimal128
[]) d128p
; /* { dg-error "cast specifies array type" } */
25 (_Decimal128 ()) d128p
; /* { dg-error "cast specifies function type" } */
27 (struct s
) d32
; /* { dg-error "conversion to non-scalar type requested" } */
29 (struct s
) d64
; /* { dg-error "conversion to non-scalar type requested" } */
30 (union u
) d64
; /* { dg-error "cast to union type from type not present in union" } */
31 (struct s
) d128
; /* { dg-error "conversion to non-scalar type requested" } */
32 (union u
) d128
; /* { dg-error "cast to union type from type not present in union" } */
34 (_Decimal32
) sv
; /* { dg-error "aggregate value used where a floating-point was expected" } */
35 (_Decimal32
) uv
; /* { dg-error "aggregate value used where a floating-point was expected" } */
36 (_Decimal64
) sv
; /* { dg-error "aggregate value used where a floating-point was expected" } */
37 (_Decimal64
) uv
; /* { dg-error "aggregate value used where a floating-point was expected" } */
38 (_Decimal128
) sv
; /* { dg-error "aggregate value used where a floating-point was expected" } */
39 (_Decimal128
) uv
; /* { dg-error "aggregate value used where a floating-point was expected" } */