Skip to content

Commit d815fbe

Browse files
committed
Do not use deprecated getFullSignature but use getIdentityString instead
Note that both `getFullSignature` and `getIdentityString` are expensive to compute. It might be better to use a cheaper alternative here.
1 parent 64d17a9 commit d815fbe

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
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/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."
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. |

0 commit comments

Comments
 (0)