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
6class Base {
7 virtual EXPORT void a();
8};
9
10class EXPORT InheritedBase {
11 virtual void a();
12};
13
14class 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
20class 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

source code of clang-tools-extra/test/clang-tidy/checkers/modernize/use-override-ms.cpp