Skip to content

Commit b6bb01f

Browse files
authored
Merge branch 'main' into mbaluda/updateql2.10.5
2 parents 4f4dc37 + ea27dfa commit b6bb01f

File tree

7 files changed

+12
-9
lines changed

7 files changed

+12
-9
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- `A13-2-2` - `BinaryOperatorAndBitwiseOperatorReturnAPrvalue.ql`
2+
- The formatting of the query output message has been changed and operators are now displayed starting with the return type instead of ending with it.

cpp/autosar/src/rules/A12-1-1/ExplicitConstructorBaseClassInitialization.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ where
3535
not init.isCompilerGenerated()
3636
) and
3737
// Must be a defined constructor
38-
c.isDefined() and
38+
c.hasDefinition() and
3939
// Not a compiler-generated constructor
4040
not c.isCompilerGenerated() and
4141
// Not a defaulted constructor

cpp/autosar/src/rules/A13-2-2/BinaryOperatorAndBitwiseOperatorReturnAPrvalue.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import cpp
1818
import codingstandards.cpp.autosar
1919
import codingstandards.cpp.Operator
20+
import semmle.code.cpp.Print
2021

2122
from Operator o
2223
where
@@ -30,5 +31,5 @@ where
3031
o.getType() instanceof ReferenceType
3132
)
3233
select o,
33-
"User-defined bitwise or arithmetic operator " + o.getFullSignature() +
34+
"User-defined bitwise or arithmetic operator " + getIdentityString(o) +
3435
" does not return a prvalue."

cpp/autosar/src/rules/A2-10-4/IdentifierNameOfStaticFunctionReusedInNamespace.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import codingstandards.cpp.autosar
1717

1818
class CandidateFunction extends Function {
1919
CandidateFunction() {
20-
isDefined() and
20+
hasDefinition() and
2121
isStatic() and
2222
not isMember() and
2323
not (

cpp/autosar/src/rules/A3-1-1/ViolationsOfOneDefinitionRule.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ where
6565
or
6666
//an non-const object defined in a header
6767
exists(GlobalOrNamespaceVariable object |
68-
object.isDefined() and
68+
object.hasDefinition() and
6969
not (
7070
object.isConstexpr()
7171
or
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
| test.cpp:16:9:16:17 | operator- | User-defined bitwise or arithmetic operator operator-(const A &, int) -> const A does not return a prvalue. |
2-
| test.cpp:20:4:20:12 | operator\| | User-defined bitwise or arithmetic operator operator\|(const A &, const A &) -> A * does not return a prvalue. |
3-
| test.cpp:24:9:24:18 | operator<< | User-defined bitwise or arithmetic operator operator<<(const A &, const A &) -> const A does not return a prvalue. |
4-
| test.cpp:34:6:34:14 | operator+ | User-defined bitwise or arithmetic operator NS_C::operator+(const C &, const C &) -> int & does not return a prvalue. |
1+
| test.cpp:16:9:16:17 | operator- | User-defined bitwise or arithmetic operator A const operator-(A const&, int) does not return a prvalue. |
2+
| test.cpp:20:4:20:12 | operator\| | User-defined bitwise or arithmetic operator A* operator\|(A const&, A const&) does not return a prvalue. |
3+
| test.cpp:24:9:24:18 | operator<< | User-defined bitwise or arithmetic operator A const operator<<(A const&, A const&) does not return a prvalue. |
4+
| test.cpp:34:6:34:14 | operator+ | User-defined bitwise or arithmetic operator int& NS_C::operator+(C const&, C const&) does not return a prvalue. |

cpp/common/src/codingstandards/cpp/TrivialType.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ predicate hasTrivialMoveConstructor(Class c) {
4848
forall(Class baseClass | baseClass = c.getABaseClass() | hasTrivialMoveConstructor(baseClass)) and
4949
// The class has to be defined, otherwise we may not see the information required to deduce
5050
// whether it does or does not have a trivial move constructor
51-
c.isDefined()
51+
c.hasDefinition()
5252
}
5353

5454
/** A trivial copy or move constructor (see [class.copy]/12). */

0 commit comments

Comments
 (0)