Skip to content

Commit e33f456

Browse files
2LoSLoS
and
LoS
authored
Fixed some warn-override tests in SemaCXX (#122680)
The `.cpp` extension have been added to test files, so that they can be runned. Besides, the `warn-suggest-override.cpp` tests have been fixed. --------- Co-authored-by: LoS <[email protected]>
1 parent 9025c26 commit e33f456

3 files changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ struct C {
1717

1818
struct D : public C {
1919
void run();
20-
// expected-warning@-1 {{'run()' overrides a member function but is not marked 'override'}}
20+
// expected-warning@-1 {{'run' overrides a member function but is not marked 'override'}}
2121
~D();
2222
};
2323

2424
struct E : public C {
2525
virtual void run();
26-
// expected-warning@-1 {{'run()' overrides a member function but is not marked 'override'}}
26+
// expected-warning@-1 {{'run' overrides a member function but is not marked 'override'}}
2727
virtual ~E();
2828
};
2929

@@ -32,7 +32,8 @@ struct F : public C {
3232
~F() override;
3333
};
3434

35-
struct G : public C {
35+
struct G : public C { // expected-note {{mark 'G' as 'final'}}
3636
void run() final;
3737
~G() final;
38+
// expected-warning@-1 {{class with destructor marked 'final' cannot be inherited from}}
3839
};

0 commit comments

Comments
 (0)