Skip to content

Commit 4e35355

Browse files
committed
Addressed review comments
1 parent 331663d commit 4e35355

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

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

+17-17
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@
1414
* external/autosar/obligation/required
1515
*/
1616

17-
import cpp
18-
import codingstandards.cpp.autosar
19-
import codingstandards.cpp.Operator
20-
import semmle.code.cpp.Print
17+
import cpp
18+
import codingstandards.cpp.autosar
19+
import codingstandards.cpp.Operator
20+
import semmle.code.cpp.Print
2121

22-
from Operator o
23-
where
24-
not isExcluded(o, OperatorInvariantsPackage::binaryOperatorAndBitwiseOperatorReturnAPrvalueQuery()) and
25-
(o instanceof UserBitwiseOperator or o instanceof UserArithmeticOperator) and
26-
(
27-
o.getType().isDeeplyConst()
28-
or
29-
o.getType() instanceof PointerType
30-
or
31-
o.getType() instanceof ReferenceType
32-
)
33-
select o,
34-
"User-defined bitwise or arithmetic operator " + o.toString() + " does not return a prvalue."
22+
from Operator o
23+
where
24+
not isExcluded(o, OperatorInvariantsPackage::binaryOperatorAndBitwiseOperatorReturnAPrvalueQuery()) and
25+
(o instanceof UserBitwiseOperator or o instanceof UserArithmeticOperator) and
26+
(
27+
o.getType().isDeeplyConst()
28+
or
29+
o.getType() instanceof PointerType
30+
or
31+
o.getType() instanceof ReferenceType
32+
)
33+
select o,
34+
"User-defined bitwise or arithmetic operator " + o.toString() + " does not return a prvalue."
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 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. |
1+
| test.cpp:16:9:16:17 | operator- | User-defined bitwise or arithmetic operator operator- does not return a prvalue. |
2+
| test.cpp:20:4:20:12 | operator\| | User-defined bitwise or arithmetic operator operator\| does not return a prvalue. |
3+
| test.cpp:24:9:24:18 | operator<< | User-defined bitwise or arithmetic operator operator<< does not return a prvalue. |
4+
| test.cpp:34:6:34:14 | operator+ | User-defined bitwise or arithmetic operator operator+ does not return a prvalue. |

0 commit comments

Comments
 (0)