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 <aurumpuro@gmail.com>
This commit is contained in:
LoS 2025-01-15 12:26:36 +01:00 committed by GitHub
parent 9025c269aa
commit e33f456ae5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 3 deletions

View File

@ -17,13 +17,13 @@ struct C {
struct D : public C {
void run();
// expected-warning@-1 {{'run()' overrides a member function but is not marked 'override'}}
// expected-warning@-1 {{'run' overrides a member function but is not marked 'override'}}
~D();
};
struct E : public C {
virtual void run();
// expected-warning@-1 {{'run()' overrides a member function but is not marked 'override'}}
// expected-warning@-1 {{'run' overrides a member function but is not marked 'override'}}
virtual ~E();
};
@ -32,7 +32,8 @@ struct F : public C {
~F() override;
};
struct G : public C {
struct G : public C { // expected-note {{mark 'G' as 'final'}}
void run() final;
~G() final;
// expected-warning@-1 {{class with destructor marked 'final' cannot be inherited from}}
};