mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Merge branch 'main' into fix-cp-in-external-flow
This commit is contained in:
@@ -144,14 +144,14 @@ class NameQualifiableElement extends Element, @namequalifiableelement {
|
||||
class NameQualifyingElement extends Element, @namequalifyingelement {
|
||||
/**
|
||||
* Gets a name qualifier for which this is the qualifying namespace or
|
||||
* user-defined type. For example: class `X` is the
|
||||
* user-defined type, or decltype. For example: class `X` is the
|
||||
* `NameQualifyingElement` and `X::` is the `NameQualifier`.
|
||||
*/
|
||||
NameQualifier getANameQualifier() {
|
||||
namequalifiers(unresolveElement(result), _, underlyingElement(this), _)
|
||||
}
|
||||
|
||||
/** Gets the name of this namespace or user-defined type. */
|
||||
/** Gets the name of this namespace, user-defined type, or decltype. */
|
||||
string getName() { none() }
|
||||
}
|
||||
|
||||
|
||||
@@ -1146,7 +1146,7 @@ class DerivedType extends Type, @derivedtype {
|
||||
* decltype(a) b;
|
||||
* ```
|
||||
*/
|
||||
class Decltype extends Type {
|
||||
class Decltype extends Type, NameQualifyingElement {
|
||||
Decltype() { decltypes(underlyingElement(this), _, 0, _, _) }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "Decltype" }
|
||||
@@ -1187,7 +1187,7 @@ class Decltype extends Type {
|
||||
|
||||
override string toString() { result = "decltype(...)" }
|
||||
|
||||
override string getName() { none() }
|
||||
override string getName() { result = "decltype(...)" }
|
||||
|
||||
override int getSize() { result = this.getBaseType().getSize() }
|
||||
|
||||
@@ -1247,7 +1247,7 @@ class TypeofType extends Type {
|
||||
|
||||
override string toString() { result = "typeof(...)" }
|
||||
|
||||
override string getName() { none() }
|
||||
override string getName() { result = "typeof(...)" }
|
||||
|
||||
override int getSize() { result = this.getBaseType().getSize() }
|
||||
|
||||
@@ -1311,8 +1311,6 @@ class TypeofTypeType extends TypeofType {
|
||||
Type getType() { type_operators(underlyingElement(this), unresolveElement(result), _, _) }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "TypeofTypeType" }
|
||||
|
||||
override string toString() { result = "typeof(...)" }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1394,7 +1392,7 @@ class IntrinsicTransformedType extends Type {
|
||||
|
||||
override Type resolveTypedefs() { result = this.getBaseType().resolveTypedefs() }
|
||||
|
||||
override string getName() { none() }
|
||||
override string getName() { result = this.getIntrinsicName() + "(...)" }
|
||||
|
||||
override int getSize() { result = this.getBaseType().getSize() }
|
||||
|
||||
|
||||
@@ -703,6 +703,7 @@ private class GuardConditionFromBinaryLogicalOperator extends GuardConditionImpl
|
||||
)
|
||||
}
|
||||
|
||||
pragma[nomagic]
|
||||
override predicate comparesLt(
|
||||
Cpp::Expr left, Cpp::Expr right, int k, boolean isLessThan, boolean testIsTrue
|
||||
) {
|
||||
@@ -713,6 +714,7 @@ private class GuardConditionFromBinaryLogicalOperator extends GuardConditionImpl
|
||||
)
|
||||
}
|
||||
|
||||
pragma[nomagic]
|
||||
override predicate comparesLt(Cpp::Expr e, int k, boolean isLessThan, GuardValue value) {
|
||||
exists(GuardValue partValue, GuardCondition part |
|
||||
this.(Cpp::BinaryLogicalOperation)
|
||||
@@ -738,6 +740,7 @@ private class GuardConditionFromBinaryLogicalOperator extends GuardConditionImpl
|
||||
)
|
||||
}
|
||||
|
||||
pragma[nomagic]
|
||||
override predicate comparesEq(
|
||||
Cpp::Expr left, Cpp::Expr right, int k, boolean areEqual, boolean testIsTrue
|
||||
) {
|
||||
@@ -757,6 +760,7 @@ private class GuardConditionFromBinaryLogicalOperator extends GuardConditionImpl
|
||||
)
|
||||
}
|
||||
|
||||
pragma[nomagic]
|
||||
override predicate comparesEq(Cpp::Expr e, int k, boolean areEqual, GuardValue value) {
|
||||
exists(GuardValue partValue, GuardCondition part |
|
||||
this.(Cpp::BinaryLogicalOperation)
|
||||
|
||||
@@ -1327,7 +1327,8 @@ specialnamequalifyingelements(
|
||||
@namequalifiableelement = @expr | @namequalifier;
|
||||
@namequalifyingelement = @namespace
|
||||
| @specialnamequalifyingelement
|
||||
| @usertype;
|
||||
| @usertype
|
||||
| @decltype;
|
||||
|
||||
namequalifiers(
|
||||
unique int id: @namequalifier,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,2 @@
|
||||
description: Fix decltype qualifier issue
|
||||
compatibility: full
|
||||
@@ -26846,14 +26846,20 @@ getParameterTypeName
|
||||
| atl.cpp:196:12:196:14 | Add | 0 | INARGTYPclass:0 |
|
||||
| atl.cpp:198:12:198:17 | Append | 0 | const CAtlArray & |
|
||||
| atl.cpp:199:10:199:13 | Copy | 0 | const CAtlArray & |
|
||||
| atl.cpp:201:8:201:12 | GetAt | 0 | decltype(...) |
|
||||
| atl.cpp:201:8:201:12 | GetAt | 0 | size_t |
|
||||
| atl.cpp:205:10:205:22 | InsertArrayAt | 0 | decltype(...) |
|
||||
| atl.cpp:205:10:205:22 | InsertArrayAt | 0 | size_t |
|
||||
| atl.cpp:205:10:205:22 | InsertArrayAt | 1 | const CAtlArray * |
|
||||
| atl.cpp:206:10:206:17 | InsertAt | 0 | decltype(...) |
|
||||
| atl.cpp:206:10:206:17 | InsertAt | 0 | size_t |
|
||||
| atl.cpp:206:10:206:17 | InsertAt | 1 | INARGTYPclass:0 |
|
||||
| atl.cpp:206:10:206:17 | InsertAt | 2 | decltype(...) |
|
||||
| atl.cpp:206:10:206:17 | InsertAt | 2 | size_t |
|
||||
| atl.cpp:211:10:211:18 | SetAtGrow | 0 | decltype(...) |
|
||||
| atl.cpp:211:10:211:18 | SetAtGrow | 0 | size_t |
|
||||
| atl.cpp:211:10:211:18 | SetAtGrow | 1 | INARGTYPclass:0 |
|
||||
| atl.cpp:213:8:213:17 | operator[] | 0 | decltype(...) |
|
||||
| atl.cpp:213:8:213:17 | operator[] | 0 | size_t |
|
||||
| atl.cpp:259:5:259:12 | CAtlList | 0 | UINT |
|
||||
| atl.cpp:259:5:259:12 | CAtlList | 0 | UINT |
|
||||
@@ -26873,6 +26879,8 @@ getParameterTypeName
|
||||
| atl.cpp:267:14:267:17 | Find | 1 | POSITION |
|
||||
| atl.cpp:267:14:267:17 | Find | 1 | __POSITION * |
|
||||
| atl.cpp:267:14:267:17 | Find | 1 | __POSITION * |
|
||||
| atl.cpp:268:14:268:22 | FindIndex | 0 | decltype(...) |
|
||||
| atl.cpp:268:14:268:22 | FindIndex | 0 | decltype(...) |
|
||||
| atl.cpp:268:14:268:22 | FindIndex | 0 | size_t |
|
||||
| atl.cpp:268:14:268:22 | FindIndex | 0 | size_t |
|
||||
| atl.cpp:269:8:269:12 | GetAt | 0 | POSITION |
|
||||
@@ -27053,6 +27061,7 @@ getParameterTypeName
|
||||
| atl.cpp:927:17:927:25 | CopyChars | 2 | int |
|
||||
| atl.cpp:928:17:928:25 | CopyChars | 0 | XCHAR * |
|
||||
| atl.cpp:928:17:928:25 | CopyChars | 0 | char * |
|
||||
| atl.cpp:928:17:928:25 | CopyChars | 1 | decltype(...) |
|
||||
| atl.cpp:928:17:928:25 | CopyChars | 1 | size_t |
|
||||
| atl.cpp:928:17:928:25 | CopyChars | 2 | const XCHAR * |
|
||||
| atl.cpp:928:17:928:25 | CopyChars | 2 | const char * |
|
||||
|
||||
Reference in New Issue
Block a user