1 | // RUN: %check_clang_tidy %s modernize-use-override %t -- -- -fms-extensions |
2 | |
3 | // This test is designed to test ms-extension __declspec(dllexport) attributes. |
4 | #define EXPORT __declspec(dllexport) |
5 | |
6 | class Base { |
7 | virtual EXPORT void a(); |
8 | }; |
9 | |
10 | class EXPORT InheritedBase { |
11 | virtual void a(); |
12 | }; |
13 | |
14 | class Derived : public Base { |
15 | virtual EXPORT void a(); |
16 | // CHECK-MESSAGES: :[[@LINE-1]]:23: warning: prefer using 'override' or (rarely) 'final' instead of 'virtual' [modernize-use-override] |
17 | // CHECK-FIXES: {{^}} EXPORT void a() override; |
18 | }; |
19 | |
20 | class EXPORT InheritedDerived : public InheritedBase { |
21 | virtual void a(); |
22 | // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: prefer using 'override' or (rarely) 'final' instead of 'virtual' [modernize-use-override] |
23 | // CHECK-FIXES: {{^}} void a() override; |
24 | }; |
25 | |
26 | |