From e3952189fc2f7075c5310ca6f9e7e4fe817bef20 Mon Sep 17 00:00:00 2001 From: Alon Alexander Date: Wed, 25 May 2022 15:01:46 +0300 Subject: [PATCH 1/3] Ignore copy/move constructors for function naming checks --- addons/naming.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/naming.py b/addons/naming.py index faaf5327e2e..948f158b6f4 100755 --- a/addons/naming.py +++ b/addons/naming.py @@ -81,7 +81,7 @@ def reportError(token, severity, msg, errorId): for scope in cfg.scopes: if scope.type == 'Function': function = scope.function - if function is not None and function.type in ('Constructor', 'Destructor'): + if function is not None and function.type in ('Constructor', 'Destructor', 'CopyConstructor', 'MoveConstructor'): continue res = re.match(RE_FUNCTIONNAME, scope.className) if not res: From 05045adcd27435a6fa0edeaeee56d6685bd16644 Mon Sep 17 00:00:00 2001 From: Alon Alexander Date: Wed, 25 May 2022 16:56:10 +0300 Subject: [PATCH 2/3] Also change in namingng --- addons/namingng.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/namingng.py b/addons/namingng.py index 84f5ed31b28..73f1b08ec08 100755 --- a/addons/namingng.py +++ b/addons/namingng.py @@ -182,7 +182,7 @@ def process(dumpfiles, configfile, debugprint=False): if "RE_FUNCTIONNAME" in conf and conf["RE_FUNCTIONNAME"]: for token in cfg.tokenlist: if token.function: - if token.function.type == 'Constructor' or token.function.type == 'Destructor': + if token.function.type in ('Constructor', 'Destructor', 'CopyConstructor', 'MoveConstructor'): continue retval = token.previous.str prev = token.previous From b2adc30604dc5f4e81bab4bc15be465933eb3968 Mon Sep 17 00:00:00 2001 From: Alon Alexander Date: Thu, 26 May 2022 09:46:10 +0300 Subject: [PATCH 3/3] Add test in naming_test.cpp --- addons/test/naming_test.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/test/naming_test.cpp b/addons/test/naming_test.cpp index 1c5bf382610..155b0caa5d5 100644 --- a/addons/test/naming_test.cpp +++ b/addons/test/naming_test.cpp @@ -6,4 +6,6 @@ class TestClass1 { TestClass1() {} ~TestClass1() {} + TestClass1(const TestClass1 &) {} + TestClass1(TestClass1 &&) {} };