1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// { dg-do compile } // { dg-options "-Wshadow" } // PR c++/57709 class C { int both_var; // { dg-message "declaration" } void var_and_method(void) {} // { dg-message "declaration" } void m() { int both_var, // { dg-warning "shadows" } var_and_method; } void m2() { void (C::*var_and_method)(void); // { dg-warning "shadows" } } };