Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CXX / class / class.mem / p8-0x.cpp
blobd2c3dc36075bb9bc4442ac260c6cdbd1c78fde90
1 // RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
3 struct Base1 {
4 virtual void g();
5 };
7 struct A : Base1 {
8 virtual void g() override override; // expected-error {{class member already marked 'override'}}
9 virtual void h() final final; // expected-error {{class member already marked 'final'}}
12 struct Base2 {
13 virtual void e1(), e2();
14 virtual void f();
17 struct B : Base2 {
18 virtual void e1() override, e2(int); // No error.
19 virtual void f() override;
20 void g() override; // expected-error {{only virtual member functions can be marked 'override'}}
21 int h override; // expected-error {{only virtual member functions can be marked 'override'}}
24 struct C {
25 virtual void f() final;
26 void g() final; // expected-error {{only virtual member functions can be marked 'final'}}
27 int h final; // expected-error {{only virtual member functions can be marked 'final'}}
30 namespace inline_extension {
31 struct Base1 {
32 virtual void g() {}
35 struct A : Base1 {
36 virtual void g() override override {} // expected-error {{class member already marked 'override'}}
37 virtual void h() final final {} // expected-error {{class member already marked 'final'}}
40 struct Base2 {
41 virtual void f();
44 struct B : Base2 {
45 virtual void f() override {}
46 void g() override {} // expected-error {{only virtual member functions can be marked 'override'}}
49 struct C {
50 virtual void f() final {}
51 void g() final {} // expected-error {{only virtual member functions can be marked 'final'}}