Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@ predicate isBinaryBitwiseOperation(Operation o, VariableAccess l, VariableAccess
)
}

from Operation o, Variable left, Variable right
from
Operation o, Variable left, Variable right, Type leftUnderlyingType, Type rightUnderlyingType
where
not isExcluded(o, ExpressionsPackage::bitwiseOperatorOperandsHaveDifferentUnderlyingTypeQuery()) and
not o.isFromUninstantiatedTemplate(_) and
isBinaryBitwiseOperation(o, left.getAnAccess(), right.getAnAccess()) and
left.getUnderlyingType() != right.getUnderlyingType()
select o, "Operands of the '" + o.getOperator() + "' operation have different underlying types."
leftUnderlyingType = left.getUnderlyingType() and
rightUnderlyingType = right.getUnderlyingType() and
leftUnderlyingType != rightUnderlyingType
select o,
"Operands of the '" + o.getOperator() + "' operation have different underlying types '" + leftUnderlyingType.getName() + "' and '" + rightUnderlyingType.getName() + "'."
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
| test.cpp:18:3:18:6 | ... & ... | Operands of the '&' operation have different underlying types. |
| test.cpp:19:3:19:7 | ... \| ... | Operands of the '\|' operation have different underlying types. |
| test.cpp:20:3:20:7 | ... ^ ... | Operands of the '^' operation have different underlying types. |
| test.cpp:21:3:21:8 | ... << ... | Operands of the '<<' operation have different underlying types. |
| test.cpp:22:3:22:8 | ... >> ... | Operands of the '>>' operation have different underlying types. |
| test.cpp:23:3:23:8 | ... &= ... | Operands of the '&=' operation have different underlying types. |
| test.cpp:24:3:24:8 | ... \|= ... | Operands of the '\|=' operation have different underlying types. |
| test.cpp:25:3:25:8 | ... ^= ... | Operands of the '^=' operation have different underlying types. |
| test.cpp:26:3:26:9 | ... <<= ... | Operands of the '<<=' operation have different underlying types. |
| test.cpp:27:3:27:9 | ... >>= ... | Operands of the '>>=' operation have different underlying types. |
| test.cpp:45:3:45:6 | ... & ... | Operands of the '&' operation have different underlying types. |
| test.cpp:46:3:46:7 | ... \| ... | Operands of the '\|' operation have different underlying types. |
| test.cpp:47:3:47:7 | ... ^ ... | Operands of the '^' operation have different underlying types. |
| test.cpp:48:3:48:8 | ... << ... | Operands of the '<<' operation have different underlying types. |
| test.cpp:49:3:49:8 | ... >> ... | Operands of the '>>' operation have different underlying types. |
| test.cpp:50:3:50:8 | ... &= ... | Operands of the '&=' operation have different underlying types. |
| test.cpp:51:3:51:8 | ... \|= ... | Operands of the '\|=' operation have different underlying types. |
| test.cpp:52:3:52:8 | ... ^= ... | Operands of the '^=' operation have different underlying types. |
| test.cpp:53:3:53:9 | ... <<= ... | Operands of the '<<=' operation have different underlying types. |
| test.cpp:54:3:54:9 | ... >>= ... | Operands of the '>>=' operation have different underlying types. |
| test.cpp:67:3:67:14 | ... << ... | Operands of the '<<' operation have different underlying types. |
| test.cpp:18:3:18:6 | ... & ... | Operands of the '&' operation have different underlying types 'unsigned int' and 'unsigned short'. |
| test.cpp:19:3:19:7 | ... \| ... | Operands of the '\|' operation have different underlying types 'unsigned int' and 'unsigned short'. |
| test.cpp:20:3:20:7 | ... ^ ... | Operands of the '^' operation have different underlying types 'unsigned int' and 'unsigned short'. |
| test.cpp:21:3:21:8 | ... << ... | Operands of the '<<' operation have different underlying types 'unsigned int' and 'unsigned short'. |
| test.cpp:22:3:22:8 | ... >> ... | Operands of the '>>' operation have different underlying types 'unsigned int' and 'unsigned short'. |
| test.cpp:23:3:23:8 | ... &= ... | Operands of the '&=' operation have different underlying types 'unsigned int' and 'unsigned short'. |
| test.cpp:24:3:24:8 | ... \|= ... | Operands of the '\|=' operation have different underlying types 'unsigned int' and 'unsigned short'. |
| test.cpp:25:3:25:8 | ... ^= ... | Operands of the '^=' operation have different underlying types 'unsigned int' and 'unsigned short'. |
| test.cpp:26:3:26:9 | ... <<= ... | Operands of the '<<=' operation have different underlying types 'unsigned int' and 'unsigned short'. |
| test.cpp:27:3:27:9 | ... >>= ... | Operands of the '>>=' operation have different underlying types 'unsigned int' and 'unsigned short'. |
| test.cpp:45:3:45:6 | ... & ... | Operands of the '&' operation have different underlying types 'unsigned char' and 'unsigned short'. |
| test.cpp:46:3:46:7 | ... \| ... | Operands of the '\|' operation have different underlying types 'unsigned char' and 'unsigned short'. |
| test.cpp:47:3:47:7 | ... ^ ... | Operands of the '^' operation have different underlying types 'unsigned char' and 'unsigned short'. |
| test.cpp:48:3:48:8 | ... << ... | Operands of the '<<' operation have different underlying types 'unsigned char' and 'unsigned short'. |
| test.cpp:49:3:49:8 | ... >> ... | Operands of the '>>' operation have different underlying types 'unsigned char' and 'unsigned short'. |
| test.cpp:50:3:50:8 | ... &= ... | Operands of the '&=' operation have different underlying types 'unsigned char' and 'unsigned short'. |
| test.cpp:51:3:51:8 | ... \|= ... | Operands of the '\|=' operation have different underlying types 'unsigned char' and 'unsigned short'. |
| test.cpp:52:3:52:8 | ... ^= ... | Operands of the '^=' operation have different underlying types 'unsigned char' and 'unsigned short'. |
| test.cpp:53:3:53:9 | ... <<= ... | Operands of the '<<=' operation have different underlying types 'unsigned char' and 'unsigned short'. |
| test.cpp:54:3:54:9 | ... >>= ... | Operands of the '>>=' operation have different underlying types 'unsigned char' and 'unsigned short'. |
| test.cpp:67:3:67:14 | ... << ... | Operands of the '<<' operation have different underlying types 'int &' and 'char &'. |