michael@0: // Copyright (c) 2012 The Chromium Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: michael@0: #include "overridden_methods.h" michael@0: michael@0: // Fill in the implementations michael@0: void DerivedClass::SomeMethod() {} michael@0: void DerivedClass::SomeOtherMethod() {} michael@0: void DerivedClass::WebKitModifiedSomething() {} michael@0: michael@0: class ImplementationInterimClass : public BaseClass { michael@0: public: michael@0: // Should not warn about pure virtual methods. michael@0: virtual void SomeMethod() = 0; michael@0: }; michael@0: michael@0: class ImplementationDerivedClass : public ImplementationInterimClass, michael@0: public webkit_glue::WebKitObserverImpl { michael@0: public: michael@0: // Should not warn about destructors. michael@0: virtual ~ImplementationDerivedClass() {} michael@0: // Should warn. michael@0: virtual void SomeMethod(); michael@0: // Should not warn if marked as override. michael@0: virtual void SomeOtherMethod() override; michael@0: // Should not warn for inline implementations in implementation files. michael@0: virtual void SomeInlineMethod() {} michael@0: // Should not warn if overriding a method whose origin is WebKit. michael@0: virtual void WebKitModifiedSomething(); michael@0: // Should warn if overridden method isn't pure. michael@0: virtual void SomeNonPureBaseMethod() {} michael@0: }; michael@0: michael@0: int main() { michael@0: DerivedClass something; michael@0: ImplementationDerivedClass something_else; michael@0: }