mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
C++: Demonstrate AmbiguouslySignedBitField FP
This commit is contained in:
@@ -3,3 +3,4 @@
|
||||
| test.cpp:20:8:20:18 | nosignshort | Bit field nosignshort of type short should have explicitly unsigned integral, explicitly signed integral, or enumeration type. |
|
||||
| test.cpp:21:18:21:30 | nosigntypedef | Bit field nosigntypedef of type int should have explicitly unsigned integral, explicitly signed integral, or enumeration type. |
|
||||
| test.cpp:23:15:23:25 | nosignconst | Bit field nosignconst of type const int should have explicitly unsigned integral, explicitly signed integral, or enumeration type. |
|
||||
| test.cpp:31:5:31:16 | templatesign | Bit field templatesign of type T should have explicitly unsigned integral, explicitly signed integral, or enumeration type. |
|
||||
|
||||
@@ -25,3 +25,10 @@ struct {
|
||||
myEnum nosignenum : 2;
|
||||
const myEnum constnosignenum : 2;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct TemplateWithBitfield {
|
||||
T templatesign : 2; // GOOD [FALSE POSITIVE]
|
||||
};
|
||||
|
||||
TemplateWithBitfield<signed int> twb;
|
||||
|
||||
Reference in New Issue
Block a user