<< BS->getSourceRange()
<< (BaseAccess == AS_protected)
<< (BS->getAccessSpecifierAsWritten() == AS_none);
+
+ if (D)
+ S.Diag(D->getLocation(), diag::note_field_decl);
+
return;
}
}
// of the base class are accessible as protected members of the
// derived class.
namespace test1 {
- class Base {
- public: int pub; static int spub;
+ class Base { // expected-note 6{{member is declared here}}
+ public:
+ int pub; // expected-note{{member is declared here}}
+ static int spub; // expected-note{{member is declared here}}
protected: int prot; static int sprot; // expected-note 4 {{declared protected here}}
private: int priv; static int spriv; // expected-note 8 {{declared private here}}
};
// the base class are accessible as private members of the derived
// class.
namespace test2 {
- class Base {
+ class Base { // expected-note 6{{member is declared here}}
public:
- int pub;
- static int spub;
+ int pub; // expected-note{{member is declared here}}
+ static int spub; // expected-note{{member is declared here}}
protected:
- int prot; // expected-note {{declared protected here}}
- static int sprot; // expected-note {{declared protected here}}
+ int prot; // expected-note {{declared protected here}} \
+ // expected-note{{member is declared here}}
+ static int sprot; // expected-note {{declared protected here}} \
+ // expected-note{{member is declared here}}
private:
int priv; // expected-note 4 {{declared private here}}
static int spriv; // expected-note 4 {{declared private here}}
};
struct D {
- public: static int x;
+ public: static int x; // expected-note{{member is declared here}}
static int test() { return x; }
};
struct E : private D { // expected-note{{constrained by private inheritance}}
namespace test2 {
class A {
- protected: static int x;
+ protected: static int x; // expected-note{{member is declared here}}
};
class B : private A {}; // expected-note {{private inheritance}}
friend struct ilist_walker_bad;
X *Prev;
protected:
- X *getPrev() { return Prev; }
+ X *getPrev() { return Prev; } // expected-note{{member is declared here}}
};
class ilist_node : private ilist_half_node { // expected-note {{declared private here}} expected-note {{constrained by private inheritance here}}
namespace test0 {
class A {
- protected: int x; // expected-note 3 {{declared}}
- static int sx; // expected-note 3 {{declared}}
+ protected: int x; // expected-note 3 {{declared}} \
+ // expected-note {{member is declared here}}
+ static int sx; // expected-note 3 {{declared}} \
+ // expected-note {{member is declared here}}
};
class B : public A {
};
namespace test4 {
class C;
class A {
- protected: int x; // expected-note 2 {{declared}}
- static int sx;
+ protected: int x; // expected-note 3 {{declared}}
+ static int sx; // expected-note 3{{member is declared here}}
static void test(C&);
};
class B : public A {
namespace test5 {
class D;
class A {
- protected: int x;
- static int sx;
+ protected: int x; // expected-note 3{{member is declared here}}
+ static int sx; // expected-note 3{{member is declared here}}
static void test(D&);
};
class B : public A {
}
namespace test9 {
- class A {
- protected: int foo(); // expected-note 8 {{declared}}
+ class A { // expected-note {{member is declared here}}
+ protected: int foo(); // expected-note 8 {{declared}} \
+ // expected-note {{member is declared here}}
};
- class B : public A {
+ class B : public A { // expected-note {{member is declared here}}
friend class D;
};
private:
operator Private(); // expected-note 4 {{declared private here}}
public:
- operator Public();
+ operator Public(); // expected-note 2{{member is declared here}}
};
class Derived1 : private Base { // expected-note 2 {{declared private here}} \
// Don't silently upgrade forbidden-access paths to private.
namespace test9 {
class A {
- public: static int x;
+ public: static int x; // expected-note {{member is declared here}}
};
class B : private A { // expected-note {{constrained by private inheritance here}}
};
namespace T6 {
class C;
- class A {};
+ class A {}; // expected-note{{member is declared here}}
class B : private A { // expected-note {{declared private here}} expected-note {{constrained by private inheritance here}}
void f(C* c);