Skip to content

Commit dfe018f

Browse files
committed
[CPP-418] Address @geoffw0's review comments.
1 parent 88a3afb commit dfe018f

File tree

2 files changed

+17
-21
lines changed

2 files changed

+17
-21
lines changed

cpp/ql/src/semmle/code/cpp/Type.qll

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ class IntegralType extends ArithmeticType, IntegralOrEnumType {
516516

517517
/**
518518
* The C/C++ boolean type. See 4.2. This is the C `_Bool` type
519-
* or the C++ `bool` type. For example,
519+
* or the C++ `bool` type. For example:
520520
* ```
521521
* extern bool a, b; // C++
522522
* _Bool c, d; // C
@@ -532,7 +532,7 @@ class BoolType extends IntegralType {
532532
/**
533533
* The C/C++ character types. See 4.3. This includes the `char`,
534534
* `signed char` and `unsigned char` types, all of which are
535-
* distinct from one another. For example,
535+
* distinct from one another. For example:
536536
* ```
537537
* char a, b;
538538
* signed char c, d;
@@ -543,7 +543,7 @@ abstract class CharType extends IntegralType { }
543543

544544
/**
545545
* The C/C++ `char` type (which is distinct from `signed char` and
546-
* `unsigned char`). For example,
546+
* `unsigned char`). For example:
547547
* ```
548548
* char a, b;
549549
* ```
@@ -833,8 +833,10 @@ class Char32Type extends IntegralType {
833833
}
834834

835835
/**
836-
* The (primitive) type of the C++11 `nullptr` constant. It is the
837-
* unspeakable type given by `decltype(nullptr)`.
836+
* The (primitive) type of the C++11 `nullptr` constant. It is a
837+
* distinct type, denoted by `decltype(nullptr)`, that is not itself a pointer
838+
* type or a pointer to member type. The `<cstddef>` header usually defines
839+
* the `std::nullptr_t` type as follows:
838840
* ```
839841
* typedef decltype(nullptr) nullptr_t;
840842
* ```
@@ -849,12 +851,11 @@ class NullPointerType extends BuiltInType {
849851
* A C/C++ derived type.
850852
*
851853
* These are pointer and reference types, array and GNU vector types, and `const` and `volatile` types.
852-
* In all cases, the type is formed from a single base type. For example,
854+
* In all cases, the type is formed from a single base type. For example:
853855
* ```
854856
* int *pi;
855857
* int &ri = *pi;
856858
* const float fa[40];
857-
* decltype(pi) dpi;
858859
* ```
859860
*/
860861
class DerivedType extends Type, @derivedtype {
@@ -906,7 +907,7 @@ class DerivedType extends Type, @derivedtype {
906907
}
907908

908909
/**
909-
* An instance of the C++11 `decltype` operator. For example,
910+
* An instance of the C++11 `decltype` operator. For example:
910911
* ```
911912
* int a;
912913
* decltype(a) b;
@@ -1202,8 +1203,8 @@ class ArrayType extends DerivedType {
12021203
* In both Clang and GNU compilers, vector types can be introduced using the
12031204
* `__attribute__((vector_size(byte_size)))` syntax. The Clang compiler also
12041205
* allows vector types to be introduced using the `ext_vector_type`,
1205-
* `neon_vector_type`, and `neon_polyvector_typ`e attributes (all of which take
1206-
* an element type rather than a byte size).
1206+
* `neon_vector_type`, and `neon_polyvector_type` attributes (all of which take
1207+
* an element count rather than a byte size).
12071208
* ```
12081209
* typedef int v4si __attribute__ (( vector_size(4*sizeof(int)) ));
12091210
* v4si v = { 1, 2, 3, 4 };

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

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ class BuiltInOperationIsNothrowAssignable extends BuiltInOperation, @isnothrowas
608608
* The `__is_standard_layout` built-in function (used by some implementations
609609
* of the `<type_traits>` header).
610610
*
611-
* Returns `true` if the type is a primitive type, or a`class`, `struct` or
611+
* Returns `true` if the type is a primitive type, or a `class`, `struct` or
612612
* `union` WITHOUT (1) virtual functions or base classes, (2) reference member
613613
* variable or (3) multiple occurrences of base `class` objects, among other
614614
* restrictions. Please see
@@ -683,8 +683,8 @@ class BuiltInOperationHasTrivialMoveConstructor extends BuiltInOperation, @hastr
683683
* (i.e., can be generated by the compiler).
684684
* ```
685685
* template<typename T>
686-
* struct is_trivially_assignable
687-
* : public integral_constant<bool, __is_trivially_assignable(T) >
686+
* struct has_trivial_move_assign
687+
* : public integral_constant<bool, __has_trivial_move_assign(T) >
688688
* { };
689689
* ```
690690
*/
@@ -718,8 +718,8 @@ class BuiltInOperationHasNothrowMoveAssign extends BuiltInOperation, @hasnothrow
718718
* (or none).
719719
* ```
720720
* template<typename T, typename... Args>
721-
* struct is_trivially_constructible
722-
* : public integral_constant<bool, __is_trivially_constructible(T) >
721+
* struct is_constructible
722+
* : public integral_constant<bool, __is_constructible(T) >
723723
* { };
724724
* ```
725725
*/
@@ -848,7 +848,7 @@ class BuiltInOperationIsSealed extends BuiltInOperation, @issealedexpr {
848848
* ref class R {}; // __is_simple_value_class(R) == false
849849
* value struct V {}; // __is_simple_value_class(V) == true
850850
* value struct V2 { // __is_simple_value_class(V2) == false
851-
* R ^ r; // not a simnple value type
851+
* R ^ r; // not a simple value type
852852
* };
853853
* ```
854854
*/
@@ -910,11 +910,6 @@ class BuiltInChooseExpr extends BuiltInOperation, @builtinchooseexpr {
910910

911911
/**
912912
* Fill operation on a vector. This is a GNU extension.
913-
* ```
914-
* typedef float float4 __attribute__((ext_vector_type(4)));
915-
* float4 v4si = (float4){ 1.0, 2.0, 3.0, 4.0 };
916-
*
917-
* ```
918913
*/
919914
class VectorFillOperation extends UnaryOperation, @vec_fill {
920915
override string getOperator() { result = "(vector fill)" }

0 commit comments

Comments
 (0)