1 /* Test for constant expressions: invalid null pointer constants in
2 various contexts (make sure NOPs are not inappropriately
4 /* Origin: Joseph Myers <joseph@codesourcery.com> */
5 /* { dg-do compile } */
6 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
8 void *p
= (__SIZE_TYPE__
)(void *)0; /* { dg-error "without a cast" } */
9 struct s
{ void *a
; } q
= { (__SIZE_TYPE__
)(void *)0 }; /* { dg-error "without a cast|near initialization" } */
14 r
= (__SIZE_TYPE__
)(void *)0; /* { dg-error "without a cast" } */
15 return (__SIZE_TYPE__
)(void *)0; /* { dg-error "without a cast" } */
17 void g (void *); /* { dg-message "but argument is of type" } */
21 g ((__SIZE_TYPE__
)(void *)0); /* { dg-error "without a cast" } */
23 void g2 (int, void *); /* { dg-message "but argument is of type" } */
27 g2 (0, (__SIZE_TYPE__
)(void *)0); /* { dg-error "without a cast" } */