[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / CXX / class.derived / class.member.lookup / p10.cpp
blobafd87521885abc677263c33bd562b51ed0dacdf3
1 // RUN: %clang_cc1 -fsyntax-only -verify %s -Wshadow-all
3 // Basic cases, ambiguous paths, and fields with different access
4 class A {
5 public:
6 int x; // expected-note 2{{declared here}}
7 protected:
8 int y; // expected-note 2{{declared here}}
9 private:
10 int z;
13 struct B : A {
16 struct C : A {
19 struct W {
20 int w; // expected-note {{declared here}}
23 struct U : W {
26 struct V : W {
29 class D {
30 public:
31 char w; // expected-note {{declared here}}
32 private:
33 char x;
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'}}
41 double z;
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 {
52 class H : F, G {
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'}}
55 int z;
58 // Indirect inheritance
59 struct I {
60 union {
61 int x; // expected-note {{declared here}}
62 int y;
66 struct J : I {
67 int x; // expected-warning {{non-static data member 'x' of 'J' shadows member inherited from type 'I'}}
70 // non-access paths
71 class N : W {
74 struct K {
75 int y;
78 struct L : private K {
81 struct M : L {
82 int y;
83 int w;
86 // Multiple ambiguous paths with different accesses
87 struct A1 {
88 int x; // expected-note {{declared here}}
91 class B1 : A1 {
94 struct B2 : A1 {
97 struct C1 : B1, B2 {
100 class D1 : C1 {
103 struct D2 : C1 {
106 class D3 : C1 {
109 struct E1 : D1, D2, D3{
110 int x; // expected-warning {{non-static data member 'x' of 'E1' shadows member inherited from type 'A1'}}