Anders Carlsson | dfc2f10 | 2011-01-22 17:51:53 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x |
| 2 | namespace Test1 { |
| 3 | |
| 4 | class A final { }; // expected-note {{'A' declared here}} |
| 5 | class B : A { }; // expected-error {{base 'A' is marked 'final'}} |
| 6 | |
| 7 | } |
| 8 | |
Anders Carlsson | 7028088 | 2011-01-22 18:07:06 +0000 | [diff] [blame] | 9 | namespace Test2 { |
| 10 | |
| 11 | template<typename T> struct A final { }; // expected-note 2 {{'A' declared here}} |
| 12 | struct B : A<int> { }; // expected-error {{base 'A' is marked 'final'}} |
| 13 | |
| 14 | template<typename T> struct C : A<T> { }; // expected-error {{base 'A' is marked 'final'}} |
| 15 | struct D : C<int> { }; // expected-note {{in instantiation of template class 'Test2::C<int>' requested here}} |
| 16 | |
| 17 | } |
| 18 | |
| 19 | namespace Test3 { |
| 20 | |
| 21 | template<typename T> struct A { }; |
| 22 | template<> struct A<int> final { }; // expected-note {{'A' declared here}} |
| 23 | |
| 24 | struct B : A<bool> { }; |
| 25 | struct C : A<int> { }; // expected-error {{base 'A' is marked 'final'}} |
| 26 | |
| 27 | } |
| 28 | |