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

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

Issue 10076002: Check implementation files for virtual and OVERRIDE (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Copyright bump Created 8 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "overridden_methods.h" 5 #include "overridden_methods.h"
6 6
7 // Fill in the implementations 7 // Fill in the implementations
8 void DerivedClass::SomeMethod() {} 8 void DerivedClass::SomeMethod() {}
9 void DerivedClass::SomeOtherMethod() {} 9 void DerivedClass::SomeOtherMethod() {}
10 void DerivedClass::WebKitModifiedSomething() {} 10 void DerivedClass::WebKitModifiedSomething() {}
11 11
12 class ImplementationInterimClass : public BaseClass {
13 public:
14 // Should not warn about pure virtual methods.
15 virtual void SomeMethod() = 0;
16 };
17
18 class ImplementationDerivedClass : public ImplementationInterimClass,
19 public webkit_glue::WebKitObserverImpl {
20 public:
21 // Should not warn about destructors.
22 virtual ~ImplementationDerivedClass() {}
23 // Should warn.
24 virtual void SomeMethod();
25 // Should not warn if marked as override.
26 virtual void SomeOtherMethod() override;
27 // Should not warn for inline implementations in implementation files.
28 virtual void SomeInlineMethod() {}
29 // Should not warn if overriding a method whose origin is WebKit.
30 virtual void WebKitModifiedSomething();
31 // Should warn if overridden method isn't pure.
32 virtual void SomeNonPureBaseMethod() {}
33 };
34
12 int main() { 35 int main() {
13 DerivedClass something; 36 DerivedClass something;
37 ImplementationDerivedClass something_else;
14 } 38 }
OLDNEW
« no previous file with comments | « tools/clang/plugins/FindBadConstructs.cpp ('k') | tools/clang/plugins/tests/overridden_methods.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698