From 99bf138c086ce56c7ac5ad2aa4c335c0d65addce Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Fri, 3 Mar 2023 19:02:30 +0100 Subject: [PATCH] Replace `isDefined` by `hasDefinition` `isDefined` QLDoc marks the predicate as being deprecated and mentions that `hasDefinition` should be used instead. --- .../rules/A12-1-1/ExplicitConstructorBaseClassInitialization.ql | 2 +- .../A2-10-4/IdentifierNameOfStaticFunctionReusedInNamespace.ql | 2 +- cpp/autosar/src/rules/A3-1-1/ViolationsOfOneDefinitionRule.ql | 2 +- cpp/common/src/codingstandards/cpp/TrivialType.qll | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cpp/autosar/src/rules/A12-1-1/ExplicitConstructorBaseClassInitialization.ql b/cpp/autosar/src/rules/A12-1-1/ExplicitConstructorBaseClassInitialization.ql index 33906535d3..e1aeec46a0 100644 --- a/cpp/autosar/src/rules/A12-1-1/ExplicitConstructorBaseClassInitialization.ql +++ b/cpp/autosar/src/rules/A12-1-1/ExplicitConstructorBaseClassInitialization.ql @@ -35,7 +35,7 @@ where not init.isCompilerGenerated() ) and // Must be a defined constructor - c.isDefined() and + c.hasDefinition() and // Not a compiler-generated constructor not c.isCompilerGenerated() and // Not a defaulted constructor diff --git a/cpp/autosar/src/rules/A2-10-4/IdentifierNameOfStaticFunctionReusedInNamespace.ql b/cpp/autosar/src/rules/A2-10-4/IdentifierNameOfStaticFunctionReusedInNamespace.ql index 8e61436d57..7a8a67c64e 100644 --- a/cpp/autosar/src/rules/A2-10-4/IdentifierNameOfStaticFunctionReusedInNamespace.ql +++ b/cpp/autosar/src/rules/A2-10-4/IdentifierNameOfStaticFunctionReusedInNamespace.ql @@ -17,7 +17,7 @@ import codingstandards.cpp.autosar class CandidateFunction extends Function { CandidateFunction() { - isDefined() and + hasDefinition() and isStatic() and not isMember() and not ( diff --git a/cpp/autosar/src/rules/A3-1-1/ViolationsOfOneDefinitionRule.ql b/cpp/autosar/src/rules/A3-1-1/ViolationsOfOneDefinitionRule.ql index 482b17ca3b..4beb91e8f4 100644 --- a/cpp/autosar/src/rules/A3-1-1/ViolationsOfOneDefinitionRule.ql +++ b/cpp/autosar/src/rules/A3-1-1/ViolationsOfOneDefinitionRule.ql @@ -65,7 +65,7 @@ where or //an non-const object defined in a header exists(GlobalOrNamespaceVariable object | - object.isDefined() and + object.hasDefinition() and not ( object.isConstexpr() or diff --git a/cpp/common/src/codingstandards/cpp/TrivialType.qll b/cpp/common/src/codingstandards/cpp/TrivialType.qll index bbbdea852d..96f09ccf81 100644 --- a/cpp/common/src/codingstandards/cpp/TrivialType.qll +++ b/cpp/common/src/codingstandards/cpp/TrivialType.qll @@ -48,7 +48,7 @@ predicate hasTrivialMoveConstructor(Class c) { forall(Class baseClass | baseClass = c.getABaseClass() | hasTrivialMoveConstructor(baseClass)) and // The class has to be defined, otherwise we may not see the information required to deduce // whether it does or does not have a trivial move constructor - c.isDefined() + c.hasDefinition() } /** A trivial copy or move constructor (see [class.copy]/12). */