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

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

Issue 8823013: One more OVERRIDE test that the code should already pass. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/clang/plugins/tests/overridden_methods.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef OVERRIDDEN_METHODS_H_ 5 #ifndef OVERRIDDEN_METHODS_H_
6 #define OVERRIDDEN_METHODS_H_ 6 #define OVERRIDDEN_METHODS_H_
7 7
8 // Should warn about overriding of methods. 8 // Should warn about overriding of methods.
9 class BaseClass { 9 class BaseClass {
10 public: 10 public:
11 virtual ~BaseClass() {} 11 virtual ~BaseClass() {}
12 virtual void SomeMethod() = 0; 12 virtual void SomeMethod() = 0;
13 virtual void SomeOtherMethod() = 0; 13 virtual void SomeOtherMethod() = 0;
14 virtual void SomeInlineMethod() = 0; 14 virtual void SomeInlineMethod() = 0;
15 virtual void SomeNonPureBaseMethod() {}
15 }; 16 };
16 17
17 class InterimClass : public BaseClass { 18 class InterimClass : public BaseClass {
18 // Should not warn about pure virtual methods. 19 // Should not warn about pure virtual methods.
19 virtual void SomeMethod() = 0; 20 virtual void SomeMethod() = 0;
20 }; 21 };
21 22
22 namespace WebKit { 23 namespace WebKit {
23 class WebKitObserver { 24 class WebKitObserver {
24 public: 25 public:
(...skipping 14 matching lines...) Expand all
39 // Should not warn about destructors. 40 // Should not warn about destructors.
40 virtual ~DerivedClass() {} 41 virtual ~DerivedClass() {}
41 // Should warn. 42 // Should warn.
42 virtual void SomeMethod(); 43 virtual void SomeMethod();
43 // Should not warn if marked as override. 44 // Should not warn if marked as override.
44 virtual void SomeOtherMethod() override; 45 virtual void SomeOtherMethod() override;
45 // Should warn for inline implementations. 46 // Should warn for inline implementations.
46 virtual void SomeInlineMethod() {} 47 virtual void SomeInlineMethod() {}
47 // Should not warn if overriding a method whose origin is WebKit. 48 // Should not warn if overriding a method whose origin is WebKit.
48 virtual void WebKitModifiedSomething(); 49 virtual void WebKitModifiedSomething();
50 // Should warn if overridden method isn't pure.
51 virtual void SomeNonPureBaseMethod() {}
49 }; 52 };
50 53
51 #endif // OVERRIDDEN_METHODS_H_ 54 #endif // OVERRIDDEN_METHODS_H_
OLDNEW
« no previous file with comments | « no previous file | tools/clang/plugins/tests/overridden_methods.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698