Merge branch 'main' into docsforautofix

This commit is contained in:
Geoffrey White
2024-07-11 16:42:27 +01:00
131 changed files with 14719 additions and 3565 deletions

View File

@@ -0,0 +1,17 @@
class Expr extends @expr {
string toString() { none() }
}
class Location extends @location_expr {
string toString() { none() }
}
predicate isExprWithNewBuiltin(Expr expr) {
exists(int kind | exprs(expr, kind, _) | 364 <= kind and kind <= 384)
}
from Expr expr, int kind, int kind_new, Location location
where
exprs(expr, kind, location) and
if isExprWithNewBuiltin(expr) then kind_new = 1 else kind_new = kind
select expr, kind_new, location

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
description: Add new builtin operations
compatibility: partial
exprs.rel: run exprs.qlo

View File

@@ -0,0 +1,4 @@
---
category: feature
---
* Added subclasses of `BuiltInOperations` for `__builtin_has_attribute`, `__builtin_is_corresponding_member`, `__builtin_is_pointer_interconvertible_with_class`, `__is_assignable_no_precondition_check`, `__is_bounded_array`, `__is_convertible`, `__is_corresponding_member`, `__is_nothrow_convertible`, `__is_pointer_interconvertible_with_class`, `__is_referenceable`, `__is_same_as`, `__is_trivially_copy_assignable`, `__is_unbounded_array`, `__is_valid_winrt_type`, `_is_win_class`, `__is_win_interface`, `__reference_binds_to_temporary`, `__reference_constructs_from_temporary`, and `__reference_converts_from_temporary`.

View File

@@ -383,6 +383,37 @@ class BuiltInOperationIsConvertibleTo extends BuiltInOperation, @isconvtoexpr {
override string getAPrimaryQlClass() { result = "BuiltInOperationIsConvertibleTo" }
}
/**
* A C++ `__is_convertible` built-in operation (used by some implementations
* of the `<type_traits>` header).
*
* Returns `true` if the first type can be converted to the second type.
* ```
* bool v = __is_convertible(MyType, OtherType);
* ```
*/
class BuiltInOperationIsConvertible extends BuiltInOperation, @isconvertible {
override string toString() { result = "__is_convertible" }
override string getAPrimaryQlClass() { result = "BuiltInOperationIsConvertible" }
}
/**
* A C++ `__is_nothrow_convertible` built-in operation (used by some implementations
* of the `<type_traits>` header).
*
* Returns `true` if the first type can be converted to the second type and the
* conversion operator has an empty exception specification.
* ```
* bool v = __is_nothrow_convertible(MyType, OtherType);
* ```
*/
class BuiltInOperationIsNothrowConvertible extends BuiltInOperation, @isnothrowconvertible {
override string toString() { result = "__is_nothrow_convertible" }
override string getAPrimaryQlClass() { result = "BuiltInOperationIsNothrowConvertible" }
}
/**
* A C++ `__is_empty` built-in operation (used by some implementations of the
* `<type_traits>` header).
@@ -647,8 +678,7 @@ class BuiltInOperationIsTriviallyAssignable extends BuiltInOperation, @istrivial
* The `__is_nothrow_assignable` built-in operation (used by some
* implementations of the `<type_traits>` header).
*
* Returns true if there exists a `C::operator =(const D& d) nothrow`
* assignment operator (i.e, with an empty exception specification).
* Returns true if there exists an assignment operator with an empty exception specification.
* ```
* bool v = __is_nothrow_assignable(MyType1, MyType2);
* ```
@@ -663,8 +693,7 @@ class BuiltInOperationIsNothrowAssignable extends BuiltInOperation, @isnothrowas
* The `__is_assignable` built-in operation (used by some implementations
* of the `<type_traits>` header).
*
* Returns true if there exists a `C::operator =(const D& d)` assignment
* operator.
* Returns true if there exists an assignment operator.
* ```
* bool v = __is_assignable(MyType1, MyType2);
* ```
@@ -675,6 +704,25 @@ class BuiltInOperationIsAssignable extends BuiltInOperation, @isassignable {
override string getAPrimaryQlClass() { result = "BuiltInOperationIsAssignable" }
}
/**
* The `__is_assignable_no_precondition_check` built-in operation (used by some
* implementations of the `<type_traits>` header).
*
* Returns true if there exists an assignment operator.
* ```
* bool v = __is_assignable_no_precondition_check(MyType1, MyType2);
* ```
*/
class BuiltInOperationIsAssignableNoPreconditionCheck extends BuiltInOperation,
@isassignablenopreconditioncheck
{
override string toString() { result = "__is_assignable_no_precondition_check" }
override string getAPrimaryQlClass() {
result = "BuiltInOperationIsAssignableNoPreconditionCheck"
}
}
/**
* The `__is_standard_layout` built-in operation (used by some implementations
* of the `<type_traits>` header).
@@ -708,6 +756,20 @@ class BuiltInOperationIsTriviallyCopyable extends BuiltInOperation, @istrivially
override string getAPrimaryQlClass() { result = "BuiltInOperationIsTriviallyCopyable" }
}
/**
* The `__is_trivially_copy_assignable` built-in operation (used by some
* implementations of the `<type_traits>` header).
*
* Returns `true` if instances of this type can be copied using a trivial
* copy operator.
*/
class BuiltInOperationIsTriviallyCopyAssignable extends BuiltInOperation, @istriviallycopyassignable
{
override string toString() { result = "__is_trivially_copy_assignable" }
override string getAPrimaryQlClass() { result = "BuiltInOperationIsTriviallyCopyAssignable" }
}
/**
* The `__is_literal_type` built-in operation (used by some implementations of
* the `<type_traits>` header).
@@ -1062,6 +1124,24 @@ class BuiltInOperationIsSame extends BuiltInOperation, @issame {
override string getAPrimaryQlClass() { result = "BuiltInOperationIsSame" }
}
/**
* A C++ `__is_same_as` built-in operation (used by some implementations of the
* `<type_traits>` header).
*
* Returns `true` if two types are the same.
* ```
* template<typename _Tp, typename _Up>
* struct is_same
* : public integral_constant<bool, __is_same_as(_Tp, _Up)>
* { };
* ```
*/
class BuiltInOperationIsSameAs extends BuiltInOperation, @issameas {
override string toString() { result = "__is_same_as" }
override string getAPrimaryQlClass() { result = "BuiltInOperationIsSameAs" }
}
/**
* A C++ `__is_function` built-in operation (used by some implementations of the
* `<type_traits>` header).
@@ -1120,6 +1200,87 @@ class BuiltInOperationIsPointerInterconvertibleBaseOf extends BuiltInOperation,
}
}
/**
* A C++ `__is_pointer_interconvertible_with_class` built-in operation (used
* by some implementations of the `<type_traits>` header).
*
* Returns `true` if a member pointer is pointer-interconvertible with a
* class type.
* ```
* template<typename _Tp, typename _Up>
* constexpr bool is_pointer_interconvertible_with_class(_Up _Tp::*mp) noexcept
* = __is_pointer_interconvertible_with_class(_Tp, mp);
* ```
*/
class BuiltInOperationIsPointerInterconvertibleWithClass extends BuiltInOperation,
@ispointerinterconvertiblewithclass
{
override string toString() { result = "__is_pointer_interconvertible_with_class" }
override string getAPrimaryQlClass() {
result = "BuiltInOperationIsPointerInterconvertibleWithClass"
}
}
/**
* A C++ `__builtin_is_pointer_interconvertible_with_class` built-in operation (used
* by some implementations of the `<type_traits>` header).
*
* Returns `true` if a member pointer is pointer-interconvertible with a class type.
* ```
* template<typename _Tp, typename _Up>
* constexpr bool is_pointer_interconvertible_with_class(_Up _Tp::*mp) noexcept
* = __builtin_is_pointer_interconvertible_with_class(mp);
* ```
*/
class BuiltInOperationBuiltInIsPointerInterconvertible extends BuiltInOperation,
@builtinispointerinterconvertiblewithclass
{
override string toString() { result = "__builtin_is_pointer_interconvertible_with_class" }
override string getAPrimaryQlClass() {
result = "BuiltInOperationBuiltInIsPointerInterconvertible"
}
}
/**
* A C++ `__is_corresponding_member` built-in operation (used
* by some implementations of the `<type_traits>` header).
*
* Returns `true` if two member pointers refer to corresponding
* members in the initial sequences of two class types.
* ```
* template<typename _Tp1, typename _Tp2, typename _Up1, typename _Up2>
* constexpr bool is_corresponding_member(_Up1 _Tp1::*mp1, _Up2 _Tp2::*mp2 ) noexcept
* = __is_corresponding_member(_Tp1, _Tp2, mp1, mp2);
* ```
*/
class BuiltInOperationIsCorrespondingMember extends BuiltInOperation, @iscorrespondingmember {
override string toString() { result = "__is_corresponding_member" }
override string getAPrimaryQlClass() { result = "BuiltInOperationIsCorrespondingMember" }
}
/**
* A C++ `__builtin_is_corresponding_member` built-in operation (used
* by some implementations of the `<type_traits>` header).
*
* Returns `true` if two member pointers refer to corresponding
* members in the initial sequences of two class types.
* ```
* template<typename _Tp1, typename _Tp2, typename _Up1, typename _Up2>
* constexpr bool is_corresponding_member(_Up1 _Tp1::*mp1, _Up2 _Tp2::*mp2 ) noexcept
* = __builtin_is_corresponding_member(mp1, mp2);
* ```
*/
class BuiltInOperationBuiltInIsCorrespondingMember extends BuiltInOperation,
@builtiniscorrespondingmember
{
override string toString() { result = "__builtin_is_corresponding_member" }
override string getAPrimaryQlClass() { result = "BuiltInOperationBuiltInIsCorrespondingMember" }
}
/**
* A C++ `__is_array` built-in operation (used by some implementations of the
* `<type_traits>` header).
@@ -1138,6 +1299,42 @@ class BuiltInOperationIsArray extends BuiltInOperation, @isarray {
override string getAPrimaryQlClass() { result = "BuiltInOperationIsArray" }
}
/**
* A C++ `__is_bounded_array` built-in operation (used by some implementations
* of the `<type_traits>` header).
*
* Returns `true` if a type is a bounded array type.
* ```
* template<typename _Tp>
* struct is_bounded_array
* : public integral_constant<bool, __is_bounded_array(_Tp)>
* { };
* ```
*/
class BuiltInOperationIsBoundedArray extends BuiltInOperation, @isboundedarray {
override string toString() { result = "__is_bounded_array" }
override string getAPrimaryQlClass() { result = "BuiltInOperationIsBoundedArray" }
}
/**
* A C++ `__is_unbounded_array` built-in operation (used by some implementations
* of the `<type_traits>` header).
*
* Returns `true` if a type is an unbounded array type.
* ```
* template<typename _Tp>
* struct is_bounded_array
* : public integral_constant<bool, __is_unbounded_array(_Tp)>
* { };
* ```
*/
class BuiltInOperationIsUnboundedArray extends BuiltInOperation, @isunboundedarray {
override string toString() { result = "__is_unbounded_array" }
override string getAPrimaryQlClass() { result = "BuiltInOperationIsUnboundedArray" }
}
/**
* A C++ `__array_rank` built-in operation (used by some implementations of the
* `<type_traits>` header).
@@ -1554,10 +1751,10 @@ class BuiltInBitCast extends BuiltInOperation, @builtinbitcast {
*
* Returns `true` if a type is a trivial type.
* ```
* template<typename _Tp>
* struct is_trivial
* : public integral_constant<bool, __is_trivial(_Tp)>
* {};
* template<typename _Tp>
* struct is_trivial
* : public integral_constant<bool, __is_trivial(_Tp)>
* {};
* ```
*/
class BuiltInIsTrivial extends BuiltInOperation, @istrivialexpr {
@@ -1565,3 +1762,126 @@ class BuiltInIsTrivial extends BuiltInOperation, @istrivialexpr {
override string getAPrimaryQlClass() { result = "BuiltInIsTrivial" }
}
/**
* A C++ `__reference_constructs_from_temporary` built-in operation
* (used by some implementations of the `<type_traits>` header).
*
* Returns `true` if a reference type `_Tp` is bound to an expression of
* type `_Up` in direct-initialization, and a temporary object is bound.
* ```
* template<typename _Tp, typename _Up>
* struct reference_constructs_from_temporary
* : public integral_constant<bool, __reference_constructs_from_temporary(_Tp, _Up)>
* {};
* ```
*/
class BuiltInOperationReferenceConstructsFromTemporary extends BuiltInOperation,
@referenceconstructsfromtemporary
{
override string toString() { result = "__reference_constructs_from_temporary" }
override string getAPrimaryQlClass() {
result = "BuiltInOperationReferenceConstructsFromTemporary"
}
}
/**
* A C++ `__reference_converts_from_temporary` built-in operation
* (used by some implementations of the `<type_traits>` header).
*
* Returns `true` if a reference type `_Tp` is bound to an expression of
* type `_Up` in copy-initialization, and a temporary object is bound.
* ```
* template<typename _Tp, typename _Up>
* struct reference_converts_from_temporary
* : public integral_constant<bool, __reference_converts_from_temporary(_Tp, _Up)>
* {};
* ```
*/
class BuiltInOperationReferenceCovertsFromTemporary extends BuiltInOperation,
@referenceconvertsfromtemporary
{
override string toString() { result = "__reference_converts_from_temporary" }
override string getAPrimaryQlClass() { result = "BuiltInOperationReferenceCovertsFromTemporary" }
}
/**
* A C++ `__reference_binds_to_temporary` built-in operation (used by some
* implementations of the `<tuple>` header).
*
* Returns `true` if a reference of type `Type1` is bound to an expression of
* type `Type1`, and a temporary object is bound.
* ```
* __reference_binds_to_temporary(Type1, Type2)
*/
class BuiltInOperationReferenceBindsToTemporary extends BuiltInOperation, @referencebindstotemporary
{
override string toString() { result = "__reference_binds_to_temporary" }
override string getAPrimaryQlClass() { result = "BuiltInOperationReferenceBindsToTemporary" }
}
/**
* A C++ `__builtin_has_attribute` built-in operation.
*
* Returns `true` if a type or expression has been declared with the
* specified attribute.
* ```
* __attribute__ ((aligned(8))) int v;
* bool has_attribute = __builtin_has_attribute(v, aligned);
* ```
*/
class BuiltInOperationHasAttribute extends BuiltInOperation, @builtinhasattribute {
override string toString() { result = "__builtin_has_attribute" }
override string getAPrimaryQlClass() { result = "BuiltInOperationHasAttribute" }
}
/**
* A C++ `__is_referenceable` built-in operation.
*
* Returns `true` if a type can be referenced.
* ```
* bool is_referenceable = __is_referenceable(int);
* ```
*/
class BuiltInOperationIsReferenceable extends BuiltInOperation, @isreferenceable {
override string toString() { result = "__is_referenceable" }
override string getAPrimaryQlClass() { result = "BuiltInOperationIsReferenceable" }
}
/**
* The `__is_valid_winrt_type` built-in operation. This is a Microsoft extension.
*
* Returns `true` if the type is a valid WinRT type.
*/
class BuiltInOperationIsValidWinRtType extends BuiltInOperation, @isvalidwinrttype {
override string toString() { result = "__is_valid_winrt_type" }
override string getAPrimaryQlClass() { result = "BuiltInOperationIsValidWinRtType" }
}
/**
* The `__is_win_class` built-in operation. This is a Microsoft extension.
*
* Returns `true` if the class is a ref class.
*/
class BuiltInOperationIsWinClass extends BuiltInOperation, @iswinclass {
override string toString() { result = "__is_win_class" }
override string getAPrimaryQlClass() { result = "BuiltInOperationIsWinClass" }
}
/**
* The `__is_win_class` built-in operation. This is a Microsoft extension.
*
* Returns `true` if the class is an interface class.
*/
class BuiltInOperationIsWinInterface extends BuiltInOperation, @iswininterface {
override string toString() { result = "__is_win_interface" }
override string getAPrimaryQlClass() { result = "BuiltInOperationIsWinInterface" }
}

View File

@@ -1748,6 +1748,25 @@ case @expr.kind of
| 361 = @isvoid
| 362 = @isvolatile
| 363 = @reuseexpr
| 364 = @istriviallycopyassignable
| 365 = @isassignablenopreconditioncheck
| 366 = @referencebindstotemporary
| 367 = @issameas
| 368 = @builtinhasattribute
| 369 = @ispointerinterconvertiblewithclass
| 370 = @builtinispointerinterconvertiblewithclass
| 371 = @iscorrespondingmember
| 372 = @builtiniscorrespondingmember
| 373 = @isboundedarray
| 374 = @isunboundedarray
| 375 = @isreferenceable
| 378 = @isnothrowconvertible
| 379 = @referenceconstructsfromtemporary
| 380 = @referenceconvertsfromtemporary
| 381 = @isconvertible
| 382 = @isvalidwinrttype
| 383 = @iswinclass
| 384 = @iswininterface
;
@var_args_expr = @vastartexpr
@@ -1842,6 +1861,25 @@ case @expr.kind of
| @isunsigned
| @isvoid
| @isvolatile
| @istriviallycopyassignable
| @isassignablenopreconditioncheck
| @referencebindstotemporary
| @issameas
| @builtinhasattribute
| @ispointerinterconvertiblewithclass
| @builtinispointerinterconvertiblewithclass
| @iscorrespondingmember
| @builtiniscorrespondingmember
| @isboundedarray
| @isunboundedarray
| @isreferenceable
| @isnothrowconvertible
| @referenceconstructsfromtemporary
| @referenceconvertsfromtemporary
| @isconvertible
| @isvalidwinrttype
| @iswinclass
| @iswininterface
;
new_allocated_type(

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
description: Add new builtin operations
compatibility: backwards

View File

@@ -1,4 +1,4 @@
// semmle-extractor-options: --clang --clang_version 100000
// semmle-extractor-options: --clang --clang_version 180000
struct S {
void f() {}
@@ -93,3 +93,18 @@ struct S2 {
bool bok_is_trivial1 = __is_trivial(int);
bool bok_is_trivial2 = __is_trivial(S2);
bool bok_reference_binds_to_temporary1 = __reference_binds_to_temporary(int&, long&);
bool bok_reference_binds_to_temporary2 = __reference_binds_to_temporary(int const &, long&);
bool b_is_same_as1 = __is_same_as(int, int);
bool b_is_same_as2 = __is_same_as(int, float);
bool b_is_bounded_array1 = __is_bounded_array(int[]);
bool b_is_bounded_array2 = __is_bounded_array(int[42]);
bool b_is_unbounded_array1 = __is_unbounded_array(int[]);
bool b_is_unbounded_array2 = __is_unbounded_array(int[42]);
bool b_is_referenceable1 = __is_referenceable(int);
bool b_is_referenceable2 = __is_referenceable(void);

View File

@@ -125,9 +125,78 @@
| clang.cpp:94:24:94:40 | int | | <none> |
| clang.cpp:95:24:95:39 | S2 | | <none> |
| clang.cpp:95:24:95:39 | __is_trivial | S2 | 0 |
| clang.cpp:97:42:97:84 | __reference_binds_to_temporary | int &,long & | 0 |
| clang.cpp:97:42:97:84 | int & | | <none> |
| clang.cpp:97:42:97:84 | long & | | <none> |
| clang.cpp:98:42:98:91 | __reference_binds_to_temporary | const int &,long & | 1 |
| clang.cpp:98:42:98:91 | const int & | | <none> |
| clang.cpp:98:42:98:91 | long & | | <none> |
| clang.cpp:100:22:100:43 | __is_same_as | int,int | 1 |
| clang.cpp:100:22:100:43 | int | | <none> |
| clang.cpp:100:22:100:43 | int | | <none> |
| clang.cpp:101:22:101:45 | __is_same_as | int,float | 0 |
| clang.cpp:101:22:101:45 | float | | <none> |
| clang.cpp:101:22:101:45 | int | | <none> |
| clang.cpp:103:28:103:52 | __is_bounded_array | int[] | 0 |
| clang.cpp:103:28:103:52 | int[] | | <none> |
| clang.cpp:104:28:104:54 | __is_bounded_array | int[42] | 1 |
| clang.cpp:104:28:104:54 | int[42] | | <none> |
| clang.cpp:104:51:104:52 | 42 | | 42 |
| clang.cpp:104:51:104:52 | (unsigned long)... | | 42 |
| clang.cpp:106:30:106:56 | __is_unbounded_array | int[] | 1 |
| clang.cpp:106:30:106:56 | int[] | | <none> |
| clang.cpp:107:30:107:58 | __is_unbounded_array | int[42] | 0 |
| clang.cpp:107:30:107:58 | int[42] | | <none> |
| clang.cpp:107:55:107:56 | 42 | | 42 |
| clang.cpp:107:55:107:56 | (unsigned long)... | | 42 |
| clang.cpp:109:28:109:50 | __is_referenceable | int | 1 |
| clang.cpp:109:28:109:50 | int | | <none> |
| clang.cpp:110:28:110:51 | __is_referenceable | void | 0 |
| clang.cpp:110:28:110:51 | void | | <none> |
| file://:0:0:0:0 | 0 | | 0 |
| file://:0:0:0:0 | 1 | | 1 |
| file://:0:0:0:0 | 2 | | 2 |
| gcc.cpp:3:25:3:25 | 8 | | 8 |
| gcc.cpp:4:25:4:59 | 0 | | 0 |
| gcc.cpp:4:25:4:59 | __builtin_has_attribute | v,0 | 1 |
| gcc.cpp:4:49:4:49 | v | | <none> |
| gcc.cpp:5:25:5:62 | 0 | | 0 |
| gcc.cpp:5:25:5:62 | __builtin_has_attribute | v,0 | 0 |
| gcc.cpp:5:49:5:49 | v | | <none> |
| gcc.cpp:13:50:13:111 | __builtin_is_pointer_interconvertible_with_class | i | 1 |
| gcc.cpp:13:99:13:110 | i | | <none> |
| gcc.cpp:14:50:14:111 | __builtin_is_pointer_interconvertible_with_class | d | 0 |
| gcc.cpp:14:99:14:110 | d | | <none> |
| gcc.cpp:16:35:16:95 | __builtin_is_corresponding_member | i,i | 1 |
| gcc.cpp:16:69:16:80 | i | | <none> |
| gcc.cpp:16:83:16:94 | i | | <none> |
| gcc.cpp:17:35:17:95 | __builtin_is_corresponding_member | i,d | 0 |
| gcc.cpp:17:69:17:80 | i | | <none> |
| gcc.cpp:17:83:17:94 | d | | <none> |
| gcc.cpp:19:34:19:67 | __is_nothrow_convertible | int,int | 1 |
| gcc.cpp:19:34:19:67 | int | | <none> |
| gcc.cpp:19:34:19:67 | int | | <none> |
| gcc.cpp:20:34:20:72 | __is_nothrow_convertible | a_struct,int | 0 |
| gcc.cpp:20:34:20:72 | a_struct | | <none> |
| gcc.cpp:20:34:20:72 | int | | <none> |
| gcc.cpp:22:26:22:51 | __is_convertible | int,int | 1 |
| gcc.cpp:22:26:22:51 | int | | <none> |
| gcc.cpp:22:26:22:51 | int | | <none> |
| gcc.cpp:23:26:23:56 | __is_convertible | a_struct,int | 0 |
| gcc.cpp:23:26:23:56 | a_struct | | <none> |
| gcc.cpp:23:26:23:56 | int | | <none> |
| gcc.cpp:25:47:25:95 | __reference_constructs_from_temporary | int &&,int | 1 |
| gcc.cpp:25:47:25:95 | int | | <none> |
| gcc.cpp:25:47:25:95 | int && | | <none> |
| gcc.cpp:26:47:26:97 | __reference_constructs_from_temporary | int &&,int && | 0 |
| gcc.cpp:26:47:26:97 | int && | | <none> |
| gcc.cpp:26:47:26:97 | int && | | <none> |
| gcc.cpp:28:45:28:91 | __reference_converts_from_temporary | int &&,int | 1 |
| gcc.cpp:28:45:28:91 | int | | <none> |
| gcc.cpp:28:45:28:91 | int && | | <none> |
| gcc.cpp:29:45:29:93 | __reference_converts_from_temporary | int &&,int && | 0 |
| gcc.cpp:29:45:29:93 | int && | | <none> |
| gcc.cpp:29:45:29:93 | int && | | <none> |
| ms.cpp:38:41:38:45 | 0 | | 0 |
| ms.cpp:88:27:88:45 | __has_assign | empty | 0 |
| ms.cpp:88:27:88:45 | empty | | <none> |
@@ -452,3 +521,38 @@
| ms.cpp:272:51:272:104 | __is_pointer_interconvertible_base_of | empty,abstract | 0 |
| ms.cpp:272:51:272:104 | abstract | | <none> |
| ms.cpp:272:51:272:104 | empty | | <none> |
| ms.cpp:274:44:274:85 | __is_trivially_copy_assignable | has_assign | 0 |
| ms.cpp:274:44:274:85 | has_assign | | <none> |
| ms.cpp:275:44:275:78 | __is_trivially_copy_assignable | int | 1 |
| ms.cpp:275:44:275:78 | int | | <none> |
| ms.cpp:277:51:277:107 | __is_assignable_no_precondition_check | a_struct,a_struct | 1 |
| ms.cpp:277:51:277:107 | a_struct | | <none> |
| ms.cpp:277:51:277:107 | a_struct | | <none> |
| ms.cpp:278:51:278:104 | __is_assignable_no_precondition_check | a_struct,empty | 0 |
| ms.cpp:278:51:278:104 | a_struct | | <none> |
| ms.cpp:278:51:278:104 | empty | | <none> |
| ms.cpp:279:51:279:102 | __is_assignable_no_precondition_check | a_struct,int | 0 |
| ms.cpp:279:51:279:102 | a_struct | | <none> |
| ms.cpp:279:51:279:102 | int | | <none> |
| ms.cpp:281:54:281:117 | __is_pointer_interconvertible_with_class | a_struct,i | 1 |
| ms.cpp:281:54:281:117 | a_struct | | <none> |
| ms.cpp:281:105:281:116 | i | | <none> |
| ms.cpp:282:54:282:117 | __is_pointer_interconvertible_with_class | a_struct,d | 0 |
| ms.cpp:282:54:282:117 | a_struct | | <none> |
| ms.cpp:282:105:282:116 | d | | <none> |
| ms.cpp:284:39:284:111 | __is_corresponding_member | a_struct,a_struct,i,i | 1 |
| ms.cpp:284:39:284:111 | a_struct | | <none> |
| ms.cpp:284:39:284:111 | a_struct | | <none> |
| ms.cpp:284:85:284:96 | i | | <none> |
| ms.cpp:284:99:284:110 | i | | <none> |
| ms.cpp:285:39:285:111 | __is_corresponding_member | a_struct,a_struct,i,d | 0 |
| ms.cpp:285:39:285:111 | a_struct | | <none> |
| ms.cpp:285:39:285:111 | a_struct | | <none> |
| ms.cpp:285:85:285:96 | i | | <none> |
| ms.cpp:285:99:285:110 | d | | <none> |
| ms.cpp:287:34:287:59 | __is_valid_winrt_type | int | 1 |
| ms.cpp:287:34:287:59 | int | | <none> |
| ms.cpp:288:27:288:45 | __is_win_class | int | 0 |
| ms.cpp:288:27:288:45 | int | | <none> |
| ms.cpp:289:31:289:53 | __is_win_interface | int | 0 |
| ms.cpp:289:31:289:53 | int | | <none> |

View File

@@ -0,0 +1,29 @@
// semmle-extractor-options: --gnu_version 130000
__attribute__ ((aligned(8))) int v;
bool b_has_attribute1 = __builtin_has_attribute(v, aligned);
bool b_has_attribute2 = __builtin_has_attribute(v, aligned(4));
struct a_struct {
int i;
double d;
};
bool b_is_pointer_interconvertible_with_class1 = __builtin_is_pointer_interconvertible_with_class(&a_struct::i);
bool b_is_pointer_interconvertible_with_class2 = __builtin_is_pointer_interconvertible_with_class(&a_struct::d);
bool b_is_corresponding_member1 = __builtin_is_corresponding_member(&a_struct::i, &a_struct::i);
bool b_is_corresponding_member2 = __builtin_is_corresponding_member(&a_struct::i, &a_struct::d);
bool b_is_nothrow_convertible1 = __is_nothrow_convertible(int, int);
bool b_is_nothrow_convertible2 = __is_nothrow_convertible(a_struct, int);
bool b_is_convertible1 = __is_convertible(int, int);
bool b_is_convertible2 = __is_convertible(a_struct, int);
bool b_reference_constructs_from_temporary1 = __reference_constructs_from_temporary(int&&, int);
bool b_reference_constructs_from_temporary2 = __reference_constructs_from_temporary(int&&, int&&);
bool b_reference_converts_from_temporary1 = __reference_converts_from_temporary(int&&, int);
bool b_reference_converts_from_temporary2 = __reference_converts_from_temporary(int&&, int&&);

View File

@@ -270,4 +270,21 @@ void f(void) {
bool b_is_pointer_interconvertible_base_of1 = __is_pointer_interconvertible_base_of(empty, empty);
bool b_is_pointer_interconvertible_base_of2 = __is_pointer_interconvertible_base_of(empty, abstract);
bool b_is_trivially_copy_assignable1 = __is_trivially_copy_assignable(has_assign);
bool b_is_trivially_copy_assignable2 = __is_trivially_copy_assignable(int);
bool b_is_assignable_no_precondition_check1 = __is_assignable_no_precondition_check(a_struct, a_struct);
bool b_is_assignable_no_precondition_check2 = __is_assignable_no_precondition_check(a_struct, empty);
bool b_is_assignable_no_precondition_check3 = __is_assignable_no_precondition_check(a_struct, int);
bool b_is_pointer_interconvertible_with_class1 = __is_pointer_interconvertible_with_class(a_struct, &a_struct::i);
bool b_is_pointer_interconvertible_with_class2 = __is_pointer_interconvertible_with_class(a_struct, &a_struct::d);
bool b_is_corresponding_member1 = __is_corresponding_member(a_struct, a_struct, &a_struct::i, &a_struct::i);
bool b_is_corresponding_member2 = __is_corresponding_member(a_struct, a_struct, &a_struct::i, &a_struct::d);
bool b_is_valid_winrt_type = __is_valid_winrt_type(int);
bool b_is_win_class = __is_win_class(int);
bool b_is_win_interface = __is_win_interface(int);
}