1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11 2*f4a2713aSLionel Sambuc namespace Test1 { 3*f4a2713aSLionel Sambuc 4*f4a2713aSLionel Sambuc class A final { }; // expected-note {{'A' declared here}} 5*f4a2713aSLionel Sambuc class B : A { }; // expected-error {{base 'A' is marked 'final'}} 6*f4a2713aSLionel Sambuc 7*f4a2713aSLionel Sambuc } 8*f4a2713aSLionel Sambuc 9*f4a2713aSLionel Sambuc namespace Test2 { 10*f4a2713aSLionel Sambuc 11*f4a2713aSLionel Sambuc template<typename T> struct A final { }; // expected-note 2 {{'A' declared here}} 12*f4a2713aSLionel Sambuc struct B : A<int> { }; // expected-error {{base 'A' is marked 'final'}} 13*f4a2713aSLionel Sambuc 14*f4a2713aSLionel Sambuc template<typename T> struct C : A<T> { }; // expected-error {{base 'A' is marked 'final'}} 15*f4a2713aSLionel Sambuc struct D : C<int> { }; // expected-note {{in instantiation of template class 'Test2::C<int>' requested here}} 16*f4a2713aSLionel Sambuc 17*f4a2713aSLionel Sambuc } 18*f4a2713aSLionel Sambuc 19*f4a2713aSLionel Sambuc namespace Test3 { 20*f4a2713aSLionel Sambuc 21*f4a2713aSLionel Sambuc template<typename T> struct A { }; 22*f4a2713aSLionel Sambuc template<> struct A<int> final { }; // expected-note {{'A' declared here}} 23*f4a2713aSLionel Sambuc 24*f4a2713aSLionel Sambuc struct B : A<bool> { }; 25*f4a2713aSLionel Sambuc struct C : A<int> { }; // expected-error {{base 'A' is marked 'final'}} 26*f4a2713aSLionel Sambuc 27*f4a2713aSLionel Sambuc } 28*f4a2713aSLionel Sambuc 29*f4a2713aSLionel Sambuc namespace Test4 { 30*f4a2713aSLionel Sambuc 31*f4a2713aSLionel Sambuc struct A final { virtual void func() = 0; }; // expected-warning {{abstract class is marked 'final'}} expected-note {{unimplemented pure virtual method 'func' in 'A'}} 32*f4a2713aSLionel Sambuc struct B { virtual void func() = 0; }; // expected-note {{unimplemented pure virtual method 'func' in 'C'}} 33*f4a2713aSLionel Sambuc 34*f4a2713aSLionel Sambuc struct C final : B { }; // expected-warning {{abstract class is marked 'final'}} 35*f4a2713aSLionel Sambuc 36*f4a2713aSLionel Sambuc } 37