OLD | NEW |
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: |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 public webkit_glue::WebKitObserverImpl { | 43 public webkit_glue::WebKitObserverImpl { |
44 public: | 44 public: |
45 // Should warn about destructors. | 45 // Should warn about destructors. |
46 virtual ~DerivedClass() {} | 46 virtual ~DerivedClass() {} |
47 // Should warn. | 47 // Should warn. |
48 virtual void SomeMethod(); | 48 virtual void SomeMethod(); |
49 // Should not warn if marked as override. | 49 // Should not warn if marked as override. |
50 void SomeOtherMethod() override; | 50 void SomeOtherMethod() override; |
51 // Should warn for inline implementations. | 51 // Should warn for inline implementations. |
52 virtual void SomeInlineMethod() {} | 52 virtual void SomeInlineMethod() {} |
53 // Should not warn if overriding a method whose origin is blink. | 53 // Should warn if overriding a method whose origin is blink. |
54 virtual void WebKitModifiedSomething(); | 54 virtual void WebKitModifiedSomething(); |
55 // Should warn with the insertion point after the const. | 55 // Should warn with the insertion point after the const. |
56 virtual void SomeConstMethod() const {} | 56 virtual void SomeConstMethod() const {} |
57 // Should warn with the insertion point after the throw spec. | 57 // Should warn with the insertion point after the throw spec. |
58 virtual void SomeMethodWithExceptionSpec() throw() {} | 58 virtual void SomeMethodWithExceptionSpec() throw() {} |
59 // Should warn with the insertion point after both the const and the throw | 59 // Should warn with the insertion point after both the const and the throw |
60 // specifiers. | 60 // specifiers. |
61 virtual void SomeConstMethodWithExceptionSpec() const throw(int) {} | 61 virtual void SomeConstMethodWithExceptionSpec() const throw(int) {} |
62 // Should warn even if overridden method isn't pure. | 62 // Should warn even if overridden method isn't pure. |
63 virtual void SomeNonPureBaseMethod() {} | 63 virtual void SomeNonPureBaseMethod() {} |
64 // Should warn and place correctly even when there is a comment. | 64 // Should warn and place correctly even when there is a comment. |
65 virtual void SomeMethodWithComment(); // This is a comment. | 65 virtual void SomeMethodWithComment(); // This is a comment. |
66 // Should warn and place correctly even if there is a comment and body. | 66 // Should warn and place correctly even if there is a comment and body. |
67 virtual void SomeMethodWithCommentAndBody() {} // This is a comment. | 67 virtual void SomeMethodWithCommentAndBody() {} // This is a comment. |
68 }; | 68 }; |
69 | 69 |
70 #endif // OVERRIDDEN_METHODS_H_ | 70 #endif // OVERRIDDEN_METHODS_H_ |
OLD | NEW |