tools/lint/cpp-virtual-final.yml
author Aaron Klotz <aklotz@mozilla.com>
Tue, 15 Jan 2019 13:39:49 -0700
changeset 511087 61a47d6d5e2617b297148e455d0a60a875df800c
parent 509327 605aa74c29e369941cbf83c23492322c1256915c
permissions -rw-r--r--
Bug 1511078: Follow-up - fix mingw build failures for TestNativeNt; r=bustage

---
cpp-virtual-final:
    description: "Virtual function declarations should specify only one of
                  `virtual`, `final`, or `override`"
    level: error
    include: ['.']
    extensions: ['cc', 'cpp', 'h', 'mm']
    type: regex
    #
    # This lint warns about:
    #
    #   virtual void Bad1() final
    #   void Bad2() final override
    #   void Bad3() override final
    #
    # Caveats: This lint ...
    #
    #   * Doesn't warn about `virtual void NotBad() override` at this time
    #     because there are currently 6963 instances of this pattern.
    #
    #   * Doesn't warn about function declarations that span multiple lines
    #     because the regex can't match across line breaks.
    #
    #           virtual    )    final  |  final  override  |  override  final
    payload: ^ *virtual .+\).+\bfinal\b|\bfinal +override\b|\boverride +final\b