1 /* { dg-do compile } */ 2 /* { dg-options "-Wuninitialized -O2" } */ 3 /* { dg-message "warnings being treated as errors" "" {target "*-*-*"} 0 } */ 4 main()5main() 6 { 7 int a; 8 int b; 9 int c; 10 int d; 11 12 #pragma GCC diagnostic error "-Wuninitialized" 13 foo(a); /* { dg-error "uninitialized" } */ 14 #pragma GCC diagnostic push 15 #pragma GCC diagnostic ignored "-Wuninitialized" 16 foo(b); 17 #pragma GCC diagnostic pop 18 foo(c); /* { dg-error "uninitialized" } */ 19 #pragma GCC diagnostic pop 20 foo(d); /* { dg-warning "uninitialized" } */ 21 } 22