Skip to content

Commit 0413e0e

Browse files
committed
C++: Clean up QLDoc and add change note
1 parent 3f789ba commit 0413e0e

File tree

2 files changed

+26
-23
lines changed

2 files changed

+26
-23
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: feature
3+
---
4+
* 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`.

cpp/ql/lib/semmle/code/cpp/exprs/BuiltInOperations.qll

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,8 @@ class BuiltInOperationIsConvertible extends BuiltInOperation, @isconvertible {
402402
* A C++ `__is_nothrow_convertible` built-in operation (used by some implementations
403403
* of the `<type_traits>` header).
404404
*
405-
* Returns `true` if the first type can be converted to the second type without
406-
* potentially rasing an exception.
405+
* Returns `true` if the first type can be converted to the second type and the
406+
* conversion operator has an empty exception specification.
407407
* ```
408408
* bool v = __is_nothrow_convertible(MyType, OtherType);
409409
* ```
@@ -678,8 +678,7 @@ class BuiltInOperationIsTriviallyAssignable extends BuiltInOperation, @istrivial
678678
* The `__is_nothrow_assignable` built-in operation (used by some
679679
* implementations of the `<type_traits>` header).
680680
*
681-
* Returns true if there exists a `C::operator =(const D& d) nothrow`
682-
* assignment operator (i.e, with an empty exception specification).
681+
* Returns true if there exists an assignment operator with an empty exception specification.
683682
* ```
684683
* bool v = __is_nothrow_assignable(MyType1, MyType2);
685684
* ```
@@ -694,8 +693,7 @@ class BuiltInOperationIsNothrowAssignable extends BuiltInOperation, @isnothrowas
694693
* The `__is_assignable` built-in operation (used by some implementations
695694
* of the `<type_traits>` header).
696695
*
697-
* Returns true if there exists a `C::operator =(const D& d)` assignment
698-
* operator.
696+
* Returns true if there exists an assignment operator.
699697
* ```
700698
* bool v = __is_assignable(MyType1, MyType2);
701699
* ```
@@ -710,8 +708,7 @@ class BuiltInOperationIsAssignable extends BuiltInOperation, @isassignable {
710708
* The `__is_assignable_no_precondition_check` built-in operation (used by some
711709
* implementations of the `<type_traits>` header).
712710
*
713-
* Returns true if there exists a `C::operator =(const D& d)` assignment
714-
* operator.
711+
* Returns true if there exists an assignment operator.
715712
* ```
716713
* bool v = __is_assignable_no_precondition_check(MyType1, MyType2);
717714
* ```
@@ -1207,7 +1204,7 @@ class BuiltInOperationIsPointerInterconvertibleBaseOf extends BuiltInOperation,
12071204
* A C++ `__is_pointer_interconvertible_with_class` built-in operation (used
12081205
* by some implementations of the `<type_traits>` header).
12091206
*
1210-
* Returns `true` if the member pointer is pointer-interconvertible with a
1207+
* Returns `true` if a member pointer is pointer-interconvertible with a
12111208
* class type.
12121209
* ```
12131210
* template<typename _Tp, typename _Up>
@@ -1229,7 +1226,7 @@ class BuiltInOperationIsPointerInterconvertibleWithClass extends BuiltInOperatio
12291226
* A C++ `__builtin_is_pointer_interconvertible_with_class` built-in operation (used
12301227
* by some implementations of the `<type_traits>` header).
12311228
*
1232-
* Returns `true` if the member pointer is pointer-interconvertible with a class type.
1229+
* Returns `true` if a member pointer is pointer-interconvertible with a class type.
12331230
* ```
12341231
* template<typename _Tp, typename _Up>
12351232
* constexpr bool is_pointer_interconvertible_with_class(_Up _Tp::*mp) noexcept
@@ -1250,7 +1247,7 @@ class BuiltInOperationBuiltInIsPointerInterconvertible extends BuiltInOperation,
12501247
* A C++ `__is_corresponding_member` built-in operation (used
12511248
* by some implementations of the `<type_traits>` header).
12521249
*
1253-
* Returns `true` if the member pointers refer to corresponding
1250+
* Returns `true` if two member pointers refer to corresponding
12541251
* members in the initial sequences of two class types.
12551252
* ```
12561253
* template<typename _Tp1, typename _Tp2, typename _Up1, typename _Up2>
@@ -1268,7 +1265,7 @@ class BuiltInOperationIsCorrespondingMember extends BuiltInOperation, @iscorresp
12681265
* A C++ `__builtin_is_corresponding_member` built-in operation (used
12691266
* by some implementations of the `<type_traits>` header).
12701267
*
1271-
* Returns `true` if the member pointers refer to corresponding
1268+
* Returns `true` if two member pointers refer to corresponding
12721269
* members in the initial sequences of two class types.
12731270
* ```
12741271
* template<typename _Tp1, typename _Tp2, typename _Up1, typename _Up2>
@@ -1770,11 +1767,12 @@ class BuiltInIsTrivial extends BuiltInOperation, @istrivialexpr {
17701767
* A C++ `__reference_constructs_from_temporary` built-in operation
17711768
* (used by some implementations of the `<type_traits>` header).
17721769
*
1773-
* Returns `true` if a type is a trivial type.
1770+
* Returns `true` if a reference type `_Tp` is bound to an expression of
1771+
* type `_Up` in direct-initialization, and a temporary object is bound.
17741772
* ```
1775-
* template<typename _Tp>
1773+
* template<typename _Tp, typename _Up>
17761774
* struct reference_constructs_from_temporary
1777-
* : public integral_constant<bool, __reference_constructs_from_temporary(_Tp)>
1775+
* : public integral_constant<bool, __reference_constructs_from_temporary(_Tp, _Up)>
17781776
* {};
17791777
* ```
17801778
*/
@@ -1792,18 +1790,19 @@ class BuiltInOperationReferenceConstructsFromTemporary extends BuiltInOperation,
17921790
* A C++ `__reference_converts_from_temporary` built-in operation
17931791
* (used by some implementations of the `<type_traits>` header).
17941792
*
1795-
* Returns `true` if a type is a trivial type.
1793+
* Returns `true` if a reference type `_Tp` is bound to an expression of
1794+
* type `_Up` in copy-initialization, and a temporary object is bound.
17961795
* ```
1797-
* template<typename _Tp>
1796+
* template<typename _Tp, typename _Up>
17981797
* struct reference_converts_from_temporary
1799-
* : public integral_constant<bool, __reference_converts_from_temporary(_Tp)>
1798+
* : public integral_constant<bool, __reference_converts_from_temporary(_Tp, _Up)>
18001799
* {};
18011800
* ```
18021801
*/
18031802
class BuiltInOperationReferenceCovertsFromTemporary extends BuiltInOperation,
18041803
@referenceconstructsfromtemporary
18051804
{
1806-
override string toString() { result = "__reference_constructs_from_temporary" }
1805+
override string toString() { result = "__reference_converts_from_temporary" }
18071806

18081807
override string getAPrimaryQlClass() { result = "BuiltInOperationReferenceCovertsFromTemporary" }
18091808
}
@@ -1812,8 +1811,8 @@ class BuiltInOperationReferenceCovertsFromTemporary extends BuiltInOperation,
18121811
* A C++ `__reference_binds_to_temporary` built-in operation (used by some
18131812
* implementations of the `<tuple>` header).
18141813
*
1815-
* Returns `true` if a reference of type `Type1` bound to an expression of
1816-
* type `Type1` binds to a temporary object.
1814+
* Returns `true` if a reference of type `Type1` is bound to an expression of
1815+
* type `Type1`, and a temporary object is bound.
18171816
* ```
18181817
* __reference_binds_to_temporary(Type1, Type2)
18191818
*/
@@ -1827,8 +1826,8 @@ class BuiltInOperationReferenceBindsToTemporary extends BuiltInOperation, @refer
18271826
/**
18281827
* A C++ `__builtin_has_attribute` built-in operation.
18291828
*
1830-
* Returns `true` if a type or expression has been declared with an
1831-
* attribute.
1829+
* Returns `true` if a type or expression has been declared with the
1830+
* specified attribute.
18321831
* ```
18331832
* __attribute__ ((aligned(8))) int v;
18341833
* bool has_attribute = __builtin_has_attribute(v, aligned);

0 commit comments

Comments
 (0)