mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
Merge pull request #21164 from jketema/jketema/builtin
C++: More builtins and information regarding this param refs
This commit is contained in:
4
cpp/ql/lib/change-notes/2026-01-09-builtins.md
Normal file
4
cpp/ql/lib/change-notes/2026-01-09-builtins.md
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
category: feature
|
||||
---
|
||||
* Added subclasses of `BuiltInOperations` for the `__is_bitwise_cloneable`, `__is_invocable`, and `__is_nothrow_invocable` builtin operations.
|
||||
4
cpp/ql/lib/change-notes/2026-01-09-this-access.md
Normal file
4
cpp/ql/lib/change-notes/2026-01-09-this-access.md
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
category: feature
|
||||
---
|
||||
* Added a `isThisAccess` predicate to `ParamAccessForType` that holds when the access is to the implicit object parameter.
|
||||
@@ -394,6 +394,11 @@ class FunctionAccess extends Access, @routineexpr {
|
||||
*/
|
||||
class ParamAccessForType extends Expr, @param_ref {
|
||||
override string toString() { result = "param access" }
|
||||
|
||||
/**
|
||||
* Holds if the accessed parameter is implicit object parameter of the function.
|
||||
*/
|
||||
predicate isThisAccess() { param_ref_to_this(underlyingElement(this)) }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1941,3 +1941,61 @@ class BuiltInOperationIsTriviallyRelocatable extends BuiltInOperation, @istrivia
|
||||
|
||||
override string getAPrimaryQlClass() { result = "BuiltInOperationIsTriviallyRelocatable" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A C++ `__is_bitwise_cloneable` built-in operation.
|
||||
*
|
||||
* Returns `true` if an object of type `_Tp` is bitwise cloneable.
|
||||
*
|
||||
* ```
|
||||
* template<typename _Tp>
|
||||
* struct is_bitwise_cloneable
|
||||
* : public integral_constant<bool, __is_bitwise_cloneable(_Tp)>
|
||||
* {};
|
||||
* ```
|
||||
*/
|
||||
class BuiltInOperationIsBitwiseCloneable extends BuiltInOperation, @isbitwisecloneable {
|
||||
override string toString() { result = "__is_bitwise_cloneable" }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "BuiltInOperationIsBitwiseCloneable" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A C++ `__is_invocable` built-in operation (used by some implementations
|
||||
* of the `<type_traits>` header).
|
||||
*
|
||||
* Returns `true` if a function of type `_FTpn` can be invoked with arguments of
|
||||
* type `_Tps`.
|
||||
*
|
||||
* ```
|
||||
* template<typename _FTpn, typename... _Tps>
|
||||
* struct is_invocable
|
||||
* : public integral_constant<bool, __is_invocable(_FTpn, _Tps...)>
|
||||
* {};
|
||||
* ```
|
||||
*/
|
||||
class BuiltInOperationIsInvocable extends BuiltInOperation, @isinvocable {
|
||||
override string toString() { result = "__is_invocable" }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "BuiltInOperationIsInvocable" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A C++ `__is_nothrow_invocable` built-in operation (used by some implementations
|
||||
* of the `<type_traits>` header).
|
||||
*
|
||||
* Returns `true` if a function of non-throwing type `_FTpn` can be invoked
|
||||
* with arguments of type `_Tps`.
|
||||
*
|
||||
* ```
|
||||
* template<typename _FTpn, typename... _Tps>
|
||||
* struct is_nothrow_invocable
|
||||
* : public integral_constant<bool, __is_nothrow_invocable(_FTpn, _Tps...)>
|
||||
* {};
|
||||
* ```
|
||||
*/
|
||||
class BuiltInOperationIsNothrowInvocable extends BuiltInOperation, @isnothrowinvocable {
|
||||
override string toString() { result = "__is_nothrow_invocable" }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "BuiltInOperationIsNothrowInvocable" }
|
||||
}
|
||||
|
||||
@@ -1902,6 +1902,9 @@ case @expr.kind of
|
||||
| 391 = @nested_requirement
|
||||
| 392 = @compound_requirement
|
||||
| 393 = @concept_id
|
||||
| 394 = @isinvocable
|
||||
| 395 = @isnothrowinvocable
|
||||
| 396 = @isbitwisecloneable
|
||||
;
|
||||
|
||||
@var_args_expr = @vastartexpr
|
||||
@@ -2018,6 +2021,9 @@ case @expr.kind of
|
||||
| @istriviallyequalitycomparable
|
||||
| @isscopedenum
|
||||
| @istriviallyrelocatable
|
||||
| @isinvocable
|
||||
| @isnothrowinvocable
|
||||
| @isbitwisecloneable
|
||||
;
|
||||
|
||||
compound_requirement_is_noexcept(
|
||||
@@ -2034,6 +2040,10 @@ new_array_allocated_type(
|
||||
int type_id: @type ref
|
||||
);
|
||||
|
||||
param_ref_to_this(
|
||||
int expr: @param_ref ref
|
||||
)
|
||||
|
||||
/**
|
||||
* The field being initialized by an initializer expression within an aggregate
|
||||
* initializer for a class/struct/union. Position is used to sort repeated initializers.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
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: Add new builtin operations and this parameter access table
|
||||
compatibility: backwards
|
||||
Reference in New Issue
Block a user