media/webrtc/trunk/tools/clang/plugins/tests/overridden_methods.cpp

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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
     3 // found in the LICENSE file.
     5 #include "overridden_methods.h"
     7 // Fill in the implementations
     8 void DerivedClass::SomeMethod() {}
     9 void DerivedClass::SomeOtherMethod() {}
    10 void DerivedClass::WebKitModifiedSomething() {}
    12 class ImplementationInterimClass : public BaseClass {
    13  public:
    14   // Should not warn about pure virtual methods.
    15   virtual void SomeMethod() = 0;
    16 };
    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 };
    35 int main() {
    36   DerivedClass something;
    37   ImplementationDerivedClass something_else;
    38 }

mercurial