1 // RUN: %clang_cc1 -fsyntax-only -verify %s -Wshadow-all
3 // Basic cases, ambiguous paths, and fields with different access
6 int x
; // expected-note 2{{declared here}}
8 int y
; // expected-note 2{{declared here}}
20 int w
; // expected-note {{declared here}}
31 char w
; // expected-note {{declared here}}
36 // Check direct inheritance and multiple paths to the same base.
37 class E
: B
, C
, D
, U
, V
39 unsigned x
; // expected-warning {{non-static data member 'x' of 'E' shadows member inherited from type 'A'}}
40 char y
; // expected-warning {{non-static data member 'y' of 'E' shadows member inherited from type 'A'}}
42 char w
; // expected-warning {{non-static data member 'w' of 'E' shadows member inherited from type 'D'}} expected-warning {{non-static data member 'w' of 'E' shadows member inherited from type 'W'}}
45 // Virtual inheritance
46 struct F
: virtual A
{
49 struct G
: virtual A
{
53 int x
; // expected-warning {{non-static data member 'x' of 'H' shadows member inherited from type 'A'}}
54 int y
; // expected-warning {{non-static data member 'y' of 'H' shadows member inherited from type 'A'}}
58 // Indirect inheritance
61 int x
; // expected-note {{declared here}}
67 int x
; // expected-warning {{non-static data member 'x' of 'J' shadows member inherited from type 'I'}}
78 struct L
: private K
{
86 // Multiple ambiguous paths with different accesses
88 int x
; // expected-note {{declared here}}
109 struct E1
: D1
, D2
, D3
{
110 int x
; // expected-warning {{non-static data member 'x' of 'E1' shadows member inherited from type 'A1'}}