Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: tools/clang/plugins/tests/virtual_method_specifiers.cpp

Issue 597863002: Update plugin to handle new style rules for virtual annotations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/annotation/specifier/g Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Tests for chromium style checks for virtual/override/final specifiers on
2 // virtual methods.
3
4 // Purposely use macros to test that the FixIt hints don't try to remove the
5 // macro body.
6 #define OVERRIDE override
7 #define FINAL final
8
9 // Base class can only use virtual.
10 class Base {
11 public:
12 virtual void F() = 0;
13 };
14
15 // Derived classes correctly use only override or final specifier.
16 class CorrectOverride : public Base {
17 public:
18 void F() OVERRIDE {}
19 };
20
21 class CorrectFinal : public CorrectOverride {
22 public:
23 void F() FINAL {}
24 };
25
26 // No override on an overridden method should trigger a diagnostic.
27 class MissingOverride : public Base {
28 public:
29 virtual void F() {}
30 };
31
32 // Redundant specifiers should trigger a diagnostic.
33 class VirtualAndOverride : public Base {
34 public:
35 virtual void F() OVERRIDE {}
36 };
37
38 class VirtualAndFinal : public Base {
39 public:
40 virtual void F() FINAL {}
41 };
42
43 class VirtualAndOverrideFinal : public Base {
44 public:
45 virtual void F() OVERRIDE FINAL {}
46 };
47
48 class OverrideAndFinal : public Base {
49 public:
50 void F() OVERRIDE FINAL {}
51 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698