Debian Codegraph @

clang/test/SemaCXX/warn-suggest-override.cpp

raw
1 // RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify -Wsuggest-override
2
3 struct A {
4 ~A();
5 void run();
6 };
7
8 struct B : public A {
9 ~B();
10 void run();
11 };
12
13 struct C {
14 virtual void run(); // expected-note 2{{overridden virtual function is here}}
15 virtual ~C();
16 };
17
18 struct D : public C {
19 void run();
20 // expected-warning@-1 {{'run' overrides a member function but is not marked 'override'}}
21 ~D();
22 };
23
24 struct E : public C {
25 virtual void run();
26 // expected-warning@-1 {{'run' overrides a member function but is not marked 'override'}}
27 virtual ~E();
28 };
29
30 struct F : public C {
31 void run() override;
32 ~F() override;
33 };
34
35 struct G : public C { // expected-note {{mark 'G' as 'final'}}
36 void run() final;
37 ~G() final;
38 // expected-warning@-1 {{class with destructor marked 'final' cannot be inherited from}}
39 };