@@ -2,12 +2,11 @@ import semmle.code.cpp.Type
22private import semmle.code.cpp.internal.ResolveClass
33
44/**
5- * A C/C++ typedef type. See 4.9.1.
6- *
7- * Represents either of the following typedef styles:
8- *
9- * * CTypedefType: typedef <type> <name>;
10- * * UsingAliasTypedefType: using <name> = <type>;
5+ * A C/C++ typedef type. See 4.9.1. For example the types declared on each line of the following code:
6+ * ```
7+ * typedef int my_int;
8+ * using my_int2 = int;
9+ * ```
1110 */
1211class TypedefType extends UserType {
1312 TypedefType ( ) {
@@ -48,7 +47,10 @@ class TypedefType extends UserType {
4847}
4948
5049/**
51- * A traditional C/C++ typedef type. See 4.9.1.
50+ * A traditional C/C++ typedef type. See 4.9.1. For example the type declared in the following code:
51+ * ```
52+ * typedef int my_int;
53+ * ```
5254 */
5355class CTypedefType extends TypedefType {
5456 CTypedefType ( ) { usertypes ( underlyingElement ( this ) , _, 5 ) }
@@ -61,7 +63,10 @@ class CTypedefType extends TypedefType {
6163}
6264
6365/**
64- * A using alias C++ typedef type.
66+ * A using alias C++ typedef type. For example the type declared in the following code:
67+ * ```
68+ * using my_int2 = int;
69+ * ```
6570 */
6671class UsingAliasTypedefType extends TypedefType {
6772 UsingAliasTypedefType ( ) { usertypes ( underlyingElement ( this ) , _, 14 ) }
@@ -74,7 +79,11 @@ class UsingAliasTypedefType extends TypedefType {
7479}
7580
7681/**
77- * A C++ typedef type that is directly enclosed by a function.
82+ * A C++ `typedef` type that is directly enclosed by a function. For example the type declared inside the function `foo` in
83+ * the following code:
84+ * ```
85+ * int foo(void) { typedef int local; }
86+ * ```
7887 */
7988class LocalTypedefType extends TypedefType {
8089 LocalTypedefType ( ) { isLocal ( ) }
@@ -83,7 +92,11 @@ class LocalTypedefType extends TypedefType {
8392}
8493
8594/**
86- * A C++ typedef type that is directly enclosed by a class, struct or union.
95+ * A C++ `typedef` type that is directly enclosed by a `class`, `struct` or `union`. For example the type declared inside
96+ * the class `C` in the following code:
97+ * ```
98+ * class C { typedef int nested; };
99+ * ```
87100 */
88101class NestedTypedefType extends TypedefType {
89102 NestedTypedefType ( ) { this .isMember ( ) }
0 commit comments