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

Side by Side Diff: tools/clang/plugins/tests/virtual_dtor_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 // Simple sanity test that virtual dtors are also being checked.
hans 2014/09/26 01:29:29 I would probably have put this in the same file as
dcheng 2014/09/26 07:07:14 Done.
2
3 // Purposely use macros to test that the FixIt hints don't try to remove the
4 // macro body.
5 #define OVERRIDE override
6 #define FINAL final
7
8 // Base class can only use virtual.
9 class Base {
10 public:
11 virtual ~Base() {}
12 };
13
14 // Derived classes correctly use only override or final specifier.
15 class CorrectOverride : public Base {
16 public:
17 ~CorrectOverride() OVERRIDE {}
18 };
19
20 class CorrectFinal : public CorrectOverride {
21 public:
22 ~CorrectFinal() FINAL {}
23 };
24
25 // No override on an overridden dtor should trigger a diagnostic.
26 class MissingOverride : public Base {
27 public:
28 virtual ~MissingOverride() {}
29 };
30
31 // Redundant specifiers should trigger a diagnostic.
32 class VirtualAndOverride : public Base {
33 public:
34 virtual ~VirtualAndOverride() OVERRIDE {}
35 };
36
37 class VirtualAndFinal : public Base {
38 public:
39 virtual ~VirtualAndFinal() FINAL {}
40 };
41
42 class VirtualAndOverrideFinal : public Base {
43 public:
44 virtual ~VirtualAndOverrideFinal() OVERRIDE FINAL {}
45 };
46
47 class OverrideAndFinal : public Base {
48 public:
49 ~OverrideAndFinal() OVERRIDE FINAL {}
50 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698