2018-02-15 11:50:02 +03:00
|
|
|
---
|
|
|
|
cpp-virtual-final:
|
|
|
|
description: "Virtual function declarations should specify only one of
|
|
|
|
`virtual`, `final`, or `override`"
|
2018-08-28 22:24:55 +03:00
|
|
|
level: error
|
2018-02-15 11:50:02 +03:00
|
|
|
include: ['.']
|
2019-01-01 00:27:22 +03:00
|
|
|
extensions: ['cc', 'cpp', 'h', 'mm']
|
2018-02-15 11:50:02 +03:00
|
|
|
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
|
2019-01-01 00:27:22 +03:00
|
|
|
# because there are currently 6963 instances of this pattern.
|
2018-02-15 11:50:02 +03:00
|
|
|
#
|
|
|
|
# * 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
|