1/* It is a constraint violation for a static function to be declared 2 but not defined if it is used except in a sizeof expression. The 3 use of the function simply being unevaluated is not enough. */ 4/* Origin: Joseph Myers <jsm@polyomino.org.uk> */ 5/* { dg-do compile } */ 6/* { dg-options "-O2 -std=iso9899:1990 -pedantic-errors" } */ 7 8/* Constraint violation (trivial case, where function is used). */ 9static void f0(void); /* { dg-error "used but never defined" } */ 10void g0(void) { f0(); } 11 12/* Constraint violation. */ 13static void f1(void); /* { dg-error "used but never defined" } */ 14void g1(void) { if (0) { f1(); } } 15 16/* Constraint violation. */ 17static int f2(void); /* { dg-error "used but never defined" } */ 18void g2(void) { 0 ? f2() : 0; } 19 20/* OK. */ 21static int f3(void); 22void g3(void) { sizeof(f3()); } 23