aboutsummaryrefslogtreecommitdiff
path: root/test/CXX/class.derived
diff options
context:
space:
mode:
Diffstat (limited to 'test/CXX/class.derived')
-rw-r--r--test/CXX/class.derived/class.abstract/p16.cpp52
-rw-r--r--test/CXX/class.derived/class.abstract/p2.cpp23
-rw-r--r--test/CXX/class.derived/class.abstract/p3.cpp97
-rw-r--r--test/CXX/class.derived/class.abstract/p4.cpp80
-rw-r--r--test/CXX/class.derived/class.abstract/p5.cpp23
-rw-r--r--test/CXX/class.derived/class.member.lookup/p10.cpp114
-rw-r--r--test/CXX/class.derived/class.member.lookup/p6.cpp40
-rw-r--r--test/CXX/class.derived/class.member.lookup/p7.cpp9
-rw-r--r--test/CXX/class.derived/class.member.lookup/p8.cpp63
-rw-r--r--test/CXX/class.derived/class.member.lookup/p9.cpp28
-rw-r--r--test/CXX/class.derived/class.virtual/p12.cpp19
-rw-r--r--test/CXX/class.derived/class.virtual/p2.cpp37
-rw-r--r--test/CXX/class.derived/class.virtual/p3-0x.cpp152
-rw-r--r--test/CXX/class.derived/p1.cpp40
-rw-r--r--test/CXX/class.derived/p2.cpp9
15 files changed, 0 insertions, 786 deletions
diff --git a/test/CXX/class.derived/class.abstract/p16.cpp b/test/CXX/class.derived/class.abstract/p16.cpp
deleted file mode 100644
index fe31b7321bd0..000000000000
--- a/test/CXX/class.derived/class.abstract/p16.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
-
-struct A {
- virtual void a(); // expected-note{{overridden virtual function is here}}
- virtual void b() = delete; // expected-note{{overridden virtual function is here}}
-};
-
-struct B: A {
- virtual void a() = delete; // expected-error{{deleted function 'a' cannot override a non-deleted function}}
- virtual void b(); // expected-error{{non-deleted function 'b' cannot override a deleted function}}
-};
-
-struct C: A {
- virtual void a();
- virtual void b() = delete;
-};
-
-struct E;
-struct F;
-struct G;
-struct H;
-struct D {
- virtual E &operator=(const E &); // expected-note {{here}}
- virtual F &operator=(const F &);
- virtual G &operator=(G&&); // expected-note {{here}}
- virtual H &operator=(H&&); // expected-note {{here}}
- friend struct F;
-
-private:
- D &operator=(const D&) = default;
- D &operator=(D&&) = default;
- virtual ~D(); // expected-note 2{{here}}
-};
-struct E : D {};
-// expected-error@-1 {{deleted function '~E' cannot override a non-deleted function}}
-// expected-note@-2 {{destructor of 'E' is implicitly deleted because base class 'D' has an inaccessible destructor}}
-// expected-error@-3 {{deleted function 'operator=' cannot override a non-deleted function}}
-// expected-note@-4 {{while declaring the implicit copy assignment operator for 'E'}}
-// expected-note@-5 {{copy assignment operator of 'E' is implicitly deleted because base class 'D' has an inaccessible copy assignment operator}}
-struct F : D {};
-struct G : D {};
-// expected-error@-1 {{deleted function '~G' cannot override a non-deleted function}}
-// expected-note@-2 {{destructor of 'G' is implicitly deleted because base class 'D' has an inaccessible destructor}}
-// expected-error@-3 {{deleted function 'operator=' cannot override a non-deleted function}}
-// expected-note@-4 {{while declaring the implicit move assignment operator for 'G'}}
-// expected-note@-5 {{move assignment operator of 'G' is implicitly deleted because base class 'D' has an inaccessible move assignment operator}}
-struct H : D { // expected-note {{deleted because base class 'D' has an inaccessible move assignment}}
- H &operator=(H&&) = default; // expected-warning {{implicitly deleted}}
- // expected-error@-1 {{deleted function 'operator=' cannot override a non-deleted function}}
- // expected-note@-3 {{move assignment operator of 'H' is implicitly deleted because base class 'D' has an inaccessible move assignment operator}}
- ~H();
-};
diff --git a/test/CXX/class.derived/class.abstract/p2.cpp b/test/CXX/class.derived/class.abstract/p2.cpp
deleted file mode 100644
index 713a5269f143..000000000000
--- a/test/CXX/class.derived/class.abstract/p2.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-// RUN: %clang_cc1 -std=c++1z -verify %s
-
-// no objects of an abstract class can be created except as subobjects of a
-// class derived from it
-
-struct A {
- A() {}
- A(int) : A() {} // ok
-
- virtual void f() = 0; // expected-note 1+{{unimplemented}}
-};
-
-void f(A &&a);
-
-void g() {
- f({}); // expected-error {{abstract class}}
- f({0}); // expected-error {{abstract class}}
- f(0); // expected-error {{abstract class}}
-}
-
-struct B : A {
- B() : A() {} // ok
-};
diff --git a/test/CXX/class.derived/class.abstract/p3.cpp b/test/CXX/class.derived/class.abstract/p3.cpp
deleted file mode 100644
index ad5b87478835..000000000000
--- a/test/CXX/class.derived/class.abstract/p3.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-// RUN: %clang_cc1 -std=c++1z -verify %s
-
-struct A {
- A() {}
- A(int) : A() {} // ok
-
- virtual void f() = 0; // expected-note 1+{{unimplemented}}
-};
-
-template<typename> struct SecretlyAbstract {
- SecretlyAbstract();
- SecretlyAbstract(int);
- virtual void f() = 0; // expected-note 1+{{unimplemented}}
-};
-using B = SecretlyAbstract<int>;
-using C = SecretlyAbstract<float>;
-using D = SecretlyAbstract<char>[1];
-
-B b; // expected-error {{abstract class}}
-D d; // expected-error {{abstract class}}
-
-template<int> struct N;
-
-// Note: C is not instantiated anywhere in this file, so we never discover that
-// it is in fact abstract. The C++ standard suggests that we need to
-// instantiate in all cases where abstractness could affect the validity of a
-// program, but that breaks a *lot* of code, so we don't do that.
-//
-// FIXME: Once DR1640 is resolved, remove the check on forming an abstract
-// array type entirely. The only restriction we need is that you can't create
-// an object of abstract (most-derived) type.
-
-
-// An abstract class shall not be used
-
-// - as a parameter type
-void f(A&);
-void f(A); // expected-error {{abstract class}}
-void f(A[1]); // expected-error {{abstract class}}
-void f(B); // expected-error {{abstract class}}
-void f(B[1]); // expected-error {{abstract class}}
-void f(C);
-void f(C[1]);
-void f(D); // expected-error {{abstract class}}
-void f(D[1]); // expected-error {{abstract class}}
-
-// - as a function return type
-A &f(N<0>);
-A *f(N<1>);
-A f(N<2>); // expected-error {{abstract class}}
-A (&f(N<3>))[2]; // expected-error {{abstract class}}
-B f(N<4>); // expected-error {{abstract class}}
-B (&f(N<5>))[2]; // expected-error {{abstract class}}
-C f(N<6>);
-C (&f(N<7>))[2];
-
-// - as the type of an explicit conversion
-void g(A&&);
-void h() {
- A(); // expected-error {{abstract class}}
- A(0); // expected-error {{abstract class}}
- A{}; // expected-error {{abstract class}}
- A{0}; // expected-error {{abstract class}}
- (A)(0); // expected-error {{abstract class}}
- (A){}; // expected-error {{abstract class}}
- (A){0}; // expected-error {{abstract class}}
-
- D(); // expected-error {{array type}}
- D{}; // expected-error {{abstract class}}
- D{0}; // expected-error {{abstract class}}
- (D){}; // expected-error {{abstract class}}
- (D){0}; // expected-error {{abstract class}}
-}
-
-template<typename T> void t(T); // expected-note 2{{abstract class}}
-void i(A &a, B &b, C &c, D &d) {
- // FIXME: These should be handled consistently. We currently reject the first
- // two early because we (probably incorrectly, depending on dr1640) take
- // abstractness into account in forming implicit conversion sequences.
- t(a); // expected-error {{no matching function}}
- t(b); // expected-error {{no matching function}}
- t(c); // expected-error {{allocating an object of abstract class type}}
- t(d); // ok, decays to pointer
-}
-
-struct E : A {
- E() : A() {} // ok
- E(int n) : A( A(n) ) {} // expected-error {{abstract class}}
-};
-
-namespace std {
- template<typename T> struct initializer_list {
- const T *begin, *end;
- initializer_list();
- };
-}
-std::initializer_list<A> ila = {1, 2, 3, 4}; // expected-error {{abstract class}}
diff --git a/test/CXX/class.derived/class.abstract/p4.cpp b/test/CXX/class.derived/class.abstract/p4.cpp
deleted file mode 100644
index b04de213874f..000000000000
--- a/test/CXX/class.derived/class.abstract/p4.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
-
-namespace PR6631 {
- struct A {
- virtual void f() = 0;
- };
-
- struct B : virtual A { };
-
- struct C : virtual A {
- virtual void f();
- };
-
- struct D : public B, public C {
- virtual void f();
- };
-
- void f() {
- (void)new D; // okay
- }
-}
-
-// Check cases where we have a virtual function that is pure in one
-// subobject but not pure in another subobject.
-namespace PartlyPure {
- struct A {
- virtual void f() = 0; // expected-note{{unimplemented pure virtual method}}
- };
-
- struct B : A {
- virtual void f();
- };
-
- struct C : virtual A { };
-
- struct D : B, C { };
-
- void f() {
- (void) new D; // expected-error{{abstract class}}
- }
-}
-
-namespace NonPureAlongOnePath {
- struct A {
- virtual void f() = 0;
- };
-
- struct B : virtual A {
- virtual void f();
- };
-
- struct C : virtual A { };
-
- struct D : B, C { };
-
- void f() {
- (void) new D; // okay
- }
-}
-
-namespace NonPureAlongOnePath2 {
- struct Aprime {
- virtual void f() = 0;
- };
-
- struct A : Aprime {
- };
-
- struct B : virtual A {
- virtual void f();
- };
-
- struct C : virtual A { };
-
- struct D : B, C { };
-
- void f() {
- (void) new D; // okay
- }
-}
diff --git a/test/CXX/class.derived/class.abstract/p5.cpp b/test/CXX/class.derived/class.abstract/p5.cpp
deleted file mode 100644
index cdff93122344..000000000000
--- a/test/CXX/class.derived/class.abstract/p5.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
-
-struct A {
- virtual void f() = 0; // expected-note{{unimplemented pure virtual method}}
-};
-
-struct B : A {
- virtual void f();
-};
-
-struct C : B {
- virtual void f() = 0; // expected-note 2{{unimplemented pure virtual method}}
-};
-
-struct D : C {
-};
-
-void test() {
- (void)new A; // expected-error{{abstract class}}
- (void)new B;
- (void)new C; // expected-error{{abstract class}}
- (void)new D; // expected-error{{abstract class}}
-}
diff --git a/test/CXX/class.derived/class.member.lookup/p10.cpp b/test/CXX/class.derived/class.member.lookup/p10.cpp
deleted file mode 100644
index afd87521885a..000000000000
--- a/test/CXX/class.derived/class.member.lookup/p10.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-// 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'}}
-};
-
-
-
diff --git a/test/CXX/class.derived/class.member.lookup/p6.cpp b/test/CXX/class.derived/class.member.lookup/p6.cpp
deleted file mode 100644
index 0a400a2405e9..000000000000
--- a/test/CXX/class.derived/class.member.lookup/p6.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s -Wshadow-field
-
-class V {
-public:
- int f();
- int x; // expected-note {{declared here}}
-};
-
-class W {
-public:
- int g(); // expected-note{{member found by ambiguous name lookup}}
- int y; // expected-note{{member found by ambiguous name lookup}} expected-note {{declared here}}
-};
-
-class B : public virtual V, public W
-{
-public:
- int f();
- int x; // expected-warning {{non-static data member 'x' of 'B' shadows member inherited from type 'V'}}
- int g(); // expected-note{{member found by ambiguous name lookup}}
- int y; // expected-note{{member found by ambiguous name lookup}} expected-warning {{non-static data member 'y' of 'B' shadows member inherited from type 'W'}}
-};
-
-class C : public virtual V, public W { };
-
-class D : public B, public C { void glorp(); };
-
-void D::glorp() {
- x++;
- f();
- y++; // expected-error{{member 'y' found in multiple base classes of different types}}
- g(); // expected-error{{member 'g' found in multiple base classes of different types}}
-}
-
-// PR6462
-struct BaseIO { BaseIO* rdbuf() { return 0; } };
-struct Pcommon : virtual BaseIO { int rdbuf() { return 0; } };
-struct P : virtual BaseIO, Pcommon {};
-
-void f() { P p; p.rdbuf(); }
diff --git a/test/CXX/class.derived/class.member.lookup/p7.cpp b/test/CXX/class.derived/class.member.lookup/p7.cpp
deleted file mode 100644
index 775057792c5c..000000000000
--- a/test/CXX/class.derived/class.member.lookup/p7.cpp
+++ /dev/null
@@ -1,9 +0,0 @@
-// RUN: %clang_cc1 -verify %s -Wshadow-field
-
-struct A { int n; }; // expected-note {{declared here}}
-struct B { float n; }; // expected-note {{declared here}}
-struct C : A, B {};
-struct D : virtual C {};
-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'}}
-struct F : D, E {} f;
-char &k = f.n;
diff --git a/test/CXX/class.derived/class.member.lookup/p8.cpp b/test/CXX/class.derived/class.member.lookup/p8.cpp
deleted file mode 100644
index 4d4acc3460e4..000000000000
--- a/test/CXX/class.derived/class.member.lookup/p8.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
-
-// FIXME: Access control checks
-
-namespace PR5820 {
- // also <rdar://problem/7535045>
- struct Base {
- void Foo();
- int Member;
- };
-
- struct D1 : public Base {};
- struct D2 : public Base {};
-
- struct Derived : public D1, public D2 {
- void Inner();
- };
-
- void Test() {
- Derived d;
- d.D1::Foo();
- d.D1::Member = 17;
- }
-
- void Derived::Inner() {
- D1::Foo();
- D1::Member = 42;
- this->D1::Foo();
- this->D1::Member = 42;
- }
-}
-
-template<typename T>
-struct BaseT {
- void Foo(); // expected-note{{found by ambiguous name lookup}}
- int Member;
-};
-
-template<typename T> struct Derived1T : BaseT<T> { };
-template<typename T> struct Derived2T : BaseT<T> { };
-
-template<typename T>
-struct DerivedT : public Derived1T<T>, public Derived2T<T> {
- void Inner();
-};
-
-template<typename T>
-void DerivedT<T>::Inner() {
- Derived1T<T>::Foo();
- Derived2T<T>::Member = 42;
- this->Derived1T<T>::Foo();
- this->Derived2T<T>::Member = 42;
- this->Foo(); // expected-error{{non-static member 'Foo' found in multiple base-class subobjects of type 'BaseT<int>'}}
-}
-
-template<typename T>
-void Test(DerivedT<T> d) {
- d.template Derived1T<T>::Foo();
- d.template Derived2T<T>::Member = 17;
- d.Inner(); // expected-note{{in instantiation}}
-}
-
-template void Test(DerivedT<int>);
diff --git a/test/CXX/class.derived/class.member.lookup/p9.cpp b/test/CXX/class.derived/class.member.lookup/p9.cpp
deleted file mode 100644
index ba7bd21f8699..000000000000
--- a/test/CXX/class.derived/class.member.lookup/p9.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
-
-namespace rdar8436162 {
- class ClsA {
- public:
- static void f();
- void g();
- };
-
- class ClsB : virtual private ClsA {
- public:
- using ClsA::f;
- using ClsA::g; // expected-note{{member found by ambiguous name lookup}}
- };
-
- class ClsF : virtual private ClsA {
- public:
- using ClsA::f;
- using ClsA::g; // expected-note{{member found by ambiguous name lookup}}
- };
-
- class ClsE : public ClsB, public ClsF {
- void test() {
- f();
- g(); // expected-error{{member 'g' found in multiple base classes of different types}}
- }
- };
-}
diff --git a/test/CXX/class.derived/class.virtual/p12.cpp b/test/CXX/class.derived/class.virtual/p12.cpp
deleted file mode 100644
index 208a0d155fe7..000000000000
--- a/test/CXX/class.derived/class.virtual/p12.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-// RUN: %clang_cc1 -ast-print %s | FileCheck %s
-
-// CHECK: test12_A::foo()
-struct test12_A {
- virtual void foo();
-
- void bar() {
- test12_A::foo();
- }
-};
-
-// CHECK: xp->test24_B::wibble()
-struct test24_B {
- virtual void wibble();
-};
-
-void foo(test24_B *xp) {
- xp->test24_B::wibble();
-}
diff --git a/test/CXX/class.derived/class.virtual/p2.cpp b/test/CXX/class.derived/class.virtual/p2.cpp
deleted file mode 100644
index 9e8d243fc3b0..000000000000
--- a/test/CXX/class.derived/class.virtual/p2.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -Wno-inaccessible-base %s
-struct A {
- virtual void f() = 0; // expected-note 2{{overridden virtual function}}
-};
-
-struct Aprime : virtual A {
- virtual void f();
-};
-
-struct B : Aprime {
- virtual void f(); // expected-note 3{{final overrider of 'A::f'}}
-};
-
-struct C : virtual A {
- virtual void f(); // expected-note{{final overrider of 'A::f'}}
-};
-
-struct D : B, C { }; // expected-error{{virtual function 'A::f' has more than one final overrider in 'D'}}
-
-struct B2 : B { };
-
-struct E : B, B2 { }; //expected-error{{virtual function 'A::f' has more than one final overrider in 'E'}}
-
-struct F : B, B2 {
- virtual void f(); // okay
-};
-
-struct G : F { }; // okay
-
-struct H : G, A { }; // okay
-
-namespace MultipleSubobjects {
- struct A { virtual void f(); };
- struct B : A { virtual void f(); };
- struct C : A { virtual void f(); };
- struct D : B, C { }; // okay
-}
diff --git a/test/CXX/class.derived/class.virtual/p3-0x.cpp b/test/CXX/class.derived/class.virtual/p3-0x.cpp
deleted file mode 100644
index 41a5954bf863..000000000000
--- a/test/CXX/class.derived/class.virtual/p3-0x.cpp
+++ /dev/null
@@ -1,152 +0,0 @@
-// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
-
-namespace Test1 {
-
-struct B {
- virtual void f(int);
-};
-
-struct D : B {
- virtual void f(long) override; // expected-error {{'f' marked 'override' but does not override any member functions}}
- void f(int) override;
-};
-}
-
-namespace Test2 {
-
-struct A {
- virtual void f(int, char, int);
-};
-
-template<typename T>
-struct B : A {
- // FIXME: Diagnose this.
- virtual void f(T) override;
-};
-
-template<typename T>
-struct C : A {
- virtual void f(int) override; // expected-error {{does not override}}
-};
-
-}
-
-namespace Test3 {
-
-struct A {
- virtual void f(int, char, int);
-};
-
-template<typename... Args>
-struct B : A {
- virtual void f(Args...) override; // expected-error {{'f' marked 'override' but does not override any member functions}}
-};
-
-template struct B<int, char, int>;
-template struct B<int>; // expected-note {{in instantiation of template class 'Test3::B<int>' requested here}}
-
-}
-
-namespace Test4 {
-struct B {
- virtual void f() const final; // expected-note {{overridden virtual function is here}}
-};
-
-struct D : B {
- void f() const; // expected-error {{declaration of 'f' overrides a 'final' function}}
-};
-
-}
-
-namespace PR13499 {
- struct X {
- virtual void f();
- virtual void h();
- };
- template<typename T> struct A : X {
- void f() override;
- void h() final;
- };
- template<typename T> struct B : X {
- void g() override; // expected-error {{only virtual member functions can be marked 'override'}}
- void i() final; // expected-error {{only virtual member functions can be marked 'final'}}
- };
- B<int> b; // no-note
- template<typename T> struct C : T {
- void g() override;
- void i() final;
- };
- template<typename T> struct D : X {
- virtual void g() override; // expected-error {{does not override}}
- virtual void i() final;
- };
- template<typename...T> struct E : X {
- void f(T...) override;
- void g(T...) override; // expected-error {{only virtual member functions can be marked 'override'}}
- void h(T...) final;
- void i(T...) final; // expected-error {{only virtual member functions can be marked 'final'}}
- };
- // FIXME: Diagnose these in the template definition, not in the instantiation.
- E<> e; // expected-note {{in instantiation of}}
-
- template<typename T> struct Y : T {
- void f() override;
- void h() final;
- };
- template<typename T> struct Z : T {
- void g() override; // expected-error {{only virtual member functions can be marked 'override'}}
- void i() final; // expected-error {{only virtual member functions can be marked 'final'}}
- };
- Y<X> y;
- Z<X> z; // expected-note {{in instantiation of}}
-}
-
-namespace MemberOfUnknownSpecialization {
- template<typename T> struct A {
- struct B {};
- struct C : B {
- void f() override;
- };
- };
-
- template<> struct A<int>::B {
- virtual void f();
- };
- // ok
- A<int>::C c1;
-
- template<> struct A<char>::B {
- void f();
- };
- // expected-error@-13 {{only virtual member functions can be marked 'override'}}
- // expected-note@+1 {{in instantiation of}}
- A<char>::C c2;
-
- template<> struct A<double>::B {
- virtual void f() final;
- };
- // expected-error@-20 {{declaration of 'f' overrides a 'final' function}}
- // expected-note@-3 {{here}}
- // expected-note@+1 {{in instantiation of}}
- A<double>::C c3;
-}
-
-namespace DiagnosticsQOI {
- struct X {
- virtual ~X();
- virtual void foo(int x); // expected-note {{hidden overloaded virtual function}}
- virtual void bar(int x); // expected-note 2 {{hidden overloaded virtual function}}
- virtual void bar(float x); // expected-note 2 {{hidden overloaded virtual function}}
- };
-
- struct Y : X {
- void foo(int x, int y) override; // expected-error {{non-virtual member function marked 'override' hides virtual member function}}
- void bar(double) override; // expected-error {{non-virtual member function marked 'override' hides virtual member functions}}
- void bar(long double) final; // expected-error {{non-virtual member function marked 'final' hides virtual member functions}}
- };
-
- template<typename T>
- struct Z : T {
- static void foo() override; // expected-error {{only virtual member functions can be marked 'override'}}
- };
-}
diff --git a/test/CXX/class.derived/p1.cpp b/test/CXX/class.derived/p1.cpp
deleted file mode 100644
index dc5cb2b8c2a3..000000000000
--- a/test/CXX/class.derived/p1.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-// RUN: %clang_cc1 %s -fsyntax-only -verify -std=c++11
-
-// base-clause:
-// : base-specifier-list
-// base-specifier-list:
-// base-specifier ...[opt]
-// base-specifier-list , base-specifier ...[opt]
-// base-specifier:
-// attribute-specifier-seq[opt] base-type-specifier
-// attribute-specifier-seq[opt] virtual access-specifier[opt] base-type-specifier
-// attribute-specifier-seq[opt] access-specifier virtual[opt] base-type-specifier
-// class-or-decltype:
-// nested-name-specifier[opt] class-name
-// decltype-specifier
-// base-type-specifier:
-// class-or-decltype
-// access-specifier:
-// private
-// protected
-// public
-
-namespace PR11216 {
- struct Base { };
- struct Derived : decltype(Base()) { };
-
- int func();
- struct Derived2 : decltype(func()) { }; // expected-error {{base specifier must name a class}}
-
- template<typename T>
- struct Derived3 : decltype(T().foo()) { };
- struct Foo { Base foo(); };
- Derived3<Foo> d;
-
- struct Derived4 : :: decltype(Base()) { }; // expected-error {{unexpected namespace scope prior to decltype}}
-
- struct Derived5 : PR11216:: decltype(Base()) { }; // expected-error {{unexpected namespace scope prior to decltype}}
-
- template<typename T>
- struct Derived6 : typename T::foo { }; // expected-error {{'typename' is redundant; base classes are implicitly types}}
-}
diff --git a/test/CXX/class.derived/p2.cpp b/test/CXX/class.derived/p2.cpp
deleted file mode 100644
index 87e0f7486154..000000000000
--- a/test/CXX/class.derived/p2.cpp
+++ /dev/null
@@ -1,9 +0,0 @@
-// RUN: %clang_cc1 %s -fsyntax-only -verify
-// expected-no-diagnostics
-
-// "During the lookup for a base class name, non-type names are ignored"
-namespace PR5840 {
- struct Base {};
- int Base = 10;
- struct Derived : Base {};
-}