1 // { dg-do compile { target c++11 } }
4 virtual void f() final {}
6 virtual void x() const {}
7 virtual void y() final;
10 void B::y() {} // { dg-message "overridden" }
19 virtual void g() override final {} // { dg-message "overridden" }
20 virtual void y() override final {} // { dg-error "virtual" }
23 template <class T> struct D2 : T
25 void h() override {} // { dg-error "marked 'override', but does not override" }
28 template <class T> struct D3 : T
35 void g() {} // { dg-error "virtual function" }
40 virtual void f() final final {} // { dg-error "duplicate virt-specifier" }
45 void f() final {} // { dg-error "marked 'final', but is not virtual" }
50 void ff() override {} // { dg-error "marked 'override', but does not override" }
51 virtual void fff() override {} // { dg-error "marked 'override', but does not override" }
52 virtual void x() override {} // { dg-error "marked 'override', but does not override" }
56 void D5::g() override {} // { dg-error "not allowed outside a class definition" }
57 void g() override {} // { dg-error "not allowed outside a class definition" }
61 friend void f() final; // { dg-error "may not have virt-specifiers" }
62 friend void g() override; // { dg-error "may not have virt-specifiers" }
63 template <class T> void h() final; // { dg-error "may not have virt-specifiers" }
64 template <class T> void i() override; // { dg-error "may not have virt-specifiers" }