1 | // RUN: %clang_cc1 -verify %s -Wshadow-field |
---|---|
2 | |
3 | struct A { int n; }; // expected-note {{declared here}} |
4 | struct B { float n; }; // expected-note {{declared here}} |
5 | struct C : A, B {}; |
6 | struct D : virtual C {}; |
7 | struct E : virtual C { char n; }; // expected-warning {{non-static data member 'n' of 'E' shadows member inherited from type 'A'}} expected-warning {{non-static data member 'n' of 'E' shadows member inherited from type 'B'}} |
8 | struct F : D, E {} f; |
9 | char &k = f.n; |
10 |