Skip to content

Commit

Permalink
Addressed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rak3-sh committed Apr 24, 2024
1 parent 331663d commit 4e35355
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@
* external/autosar/obligation/required
*/

import cpp
import codingstandards.cpp.autosar
import codingstandards.cpp.Operator
import semmle.code.cpp.Print
import cpp
import codingstandards.cpp.autosar
import codingstandards.cpp.Operator
import semmle.code.cpp.Print

from Operator o
where
not isExcluded(o, OperatorInvariantsPackage::binaryOperatorAndBitwiseOperatorReturnAPrvalueQuery()) and
(o instanceof UserBitwiseOperator or o instanceof UserArithmeticOperator) and
(
o.getType().isDeeplyConst()
or
o.getType() instanceof PointerType
or
o.getType() instanceof ReferenceType
)
select o,
"User-defined bitwise or arithmetic operator " + o.toString() + " does not return a prvalue."
from Operator o
where
not isExcluded(o, OperatorInvariantsPackage::binaryOperatorAndBitwiseOperatorReturnAPrvalueQuery()) and
(o instanceof UserBitwiseOperator or o instanceof UserArithmeticOperator) and
(
o.getType().isDeeplyConst()
or
o.getType() instanceof PointerType
or
o.getType() instanceof ReferenceType
)
select o,
"User-defined bitwise or arithmetic operator " + o.toString() + " does not return a prvalue."
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
| test.cpp:16:9:16:17 | operator- | User-defined bitwise or arithmetic operator A const operator-(A const&, int) does not return a prvalue. |
| test.cpp:20:4:20:12 | operator\| | User-defined bitwise or arithmetic operator A* operator\|(A const&, A const&) does not return a prvalue. |
| 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. |
| 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. |
| test.cpp:16:9:16:17 | operator- | User-defined bitwise or arithmetic operator operator- does not return a prvalue. |
| test.cpp:20:4:20:12 | operator\| | User-defined bitwise or arithmetic operator operator\| does not return a prvalue. |
| test.cpp:24:9:24:18 | operator<< | User-defined bitwise or arithmetic operator operator<< does not return a prvalue. |
| test.cpp:34:6:34:14 | operator+ | User-defined bitwise or arithmetic operator operator+ does not return a prvalue. |

0 comments on commit 4e35355

Please sign in to comment.