Files
TheRock/compiler/amd-llvm/clang/test/CXX/class.derived/class.member.lookup/p10.cpp
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

115 lines
2.0 KiB
C++

// RUN: %clang_cc1 -fsyntax-only -verify %s -Wshadow-all
// Basic cases, ambiguous paths, and fields with different access
class A {
public:
int x; // expected-note 2{{declared here}}
protected:
int y; // expected-note 2{{declared here}}
private:
int z;
};
struct B : A {
};
struct C : A {
};
struct W {
int w; // expected-note {{declared here}}
};
struct U : W {
};
struct V : W {
};
class D {
public:
char w; // expected-note {{declared here}}
private:
char x;
};
// Check direct inheritance and multiple paths to the same base.
class E : B, C, D, U, V
{
unsigned x; // expected-warning {{non-static data member 'x' of 'E' shadows member inherited from type 'A'}}
char y; // expected-warning {{non-static data member 'y' of 'E' shadows member inherited from type 'A'}}
double z;
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'}}
};
// Virtual inheritance
struct F : virtual A {
};
struct G : virtual A {
};
class H : F, G {
int x; // expected-warning {{non-static data member 'x' of 'H' shadows member inherited from type 'A'}}
int y; // expected-warning {{non-static data member 'y' of 'H' shadows member inherited from type 'A'}}
int z;
};
// Indirect inheritance
struct I {
union {
int x; // expected-note {{declared here}}
int y;
};
};
struct J : I {
int x; // expected-warning {{non-static data member 'x' of 'J' shadows member inherited from type 'I'}}
};
// non-access paths
class N : W {
};
struct K {
int y;
};
struct L : private K {
};
struct M : L {
int y;
int w;
};
// Multiple ambiguous paths with different accesses
struct A1 {
int x; // expected-note {{declared here}}
};
class B1 : A1 {
};
struct B2 : A1 {
};
struct C1 : B1, B2 {
};
class D1 : C1 {
};
struct D2 : C1 {
};
class D3 : C1 {
};
struct E1 : D1, D2, D3{
int x; // expected-warning {{non-static data member 'x' of 'E1' shadows member inherited from type 'A1'}}
};