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

Side by Side Diff: tools/clang/plugins/tests/virtual_bodies.h

Issue 1385193002: Bisect clang Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 246985 Created 5 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 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef VIRTUAL_METHODS_H_
6 #define VIRTUAL_METHODS_H_
7
8 // Note: This is not actual windows.h but the stub file in system/windows.h
9 #include <windows.h>
10
11 #define CR_BEGIN_MSG_MAP_EX(theClass) virtual int f() { return 4; }
12 #define BEGIN_SAFE_MSG_MAP_EX(theClass) virtual int g() { return 4; }
13
14 // Should warn about virtual method usage.
15 class VirtualMethodsInHeaders {
16 public:
17 // Don't complain about these.
18 virtual void MethodIsAbstract() = 0;
19 virtual void MethodHasNoArguments();
20 virtual void MethodHasEmptyDefaultImpl() {}
21
22 // But complain about this:
23 virtual bool ComplainAboutThis() { return true; }
24
25 SYSTEM_INLINE_VIRTUAL
26 CR_BEGIN_MSG_MAP_EX(Sub)
27 BEGIN_SAFE_MSG_MAP_EX(Sub)
28 };
29
30 // Complain on missing 'virtual' keyword in overrides.
31 class WarnOnMissingVirtual : public VirtualMethodsInHeaders {
32 public:
33 void MethodHasNoArguments() override;
34 };
35
36 // Don't complain about things in a 'testing' namespace.
37 namespace testing {
38 struct TestStruct {};
39 } // namespace testing
40
41 class VirtualMethodsInHeadersTesting : public VirtualMethodsInHeaders {
42 public:
43 // Don't complain about no virtual testing methods.
44 void MethodHasNoArguments();
45
46 private:
47 testing::TestStruct tester_;
48 };
49
50 #endif // VIRTUAL_METHODS_H_
OLDNEW
« no previous file with comments | « tools/clang/plugins/tests/virtual_base_method_also_final.txt ('k') | tools/clang/plugins/tests/virtual_bodies.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698