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:1990 -pedantic-errors" } */
8 __extension__
typedef __SIZE_TYPE__
size_t;
10 void *p
= (size_t)(void *)0; /* { dg-error "without a cast" } */
11 struct s
{ void *a
; } q
= { (size_t)(void *)0 }; /* { dg-error "without a cast|near initialization" } */
16 r
= (size_t)(void *)0; /* { dg-error "without a cast" } */
17 return (size_t)(void *)0; /* { dg-error "without a cast" } */
19 void g (void *); /* { dg-message "but argument is of type" } */
23 g ((size_t)(void *)0); /* { dg-error "without a cast" } */
25 void g2 (int, void *); /* { dg-message "but argument is of type" } */
29 g2 (0, (size_t)(void *)0); /* { dg-error "without a cast" } */