CXCursorKind

Describes the kind of entity that a cursor refers to.

Values

ValueMeaning
CXCursor_UnexposedDecl1

A declaration whose specific kind is not exposed via this interface.

Unexposed declarations have the same operations as any other kind of declaration; one can extract their location information, spelling, find their definitions, etc. However, the specific kind of the declaration is not reported.

CXCursor_StructDecl2

A C or C++ struct.

CXCursor_UnionDecl3

A C or C++ union.

CXCursor_ClassDecl4

A C++ class.

CXCursor_EnumDecl5

An enumeration.

CXCursor_FieldDecl6

A field (in C) or non-static data member (in C++) in a struct, union, or C++ class.

CXCursor_EnumConstantDecl7

An enumerator constant.

CXCursor_FunctionDecl8

A function.

CXCursor_VarDecl9

A variable.

CXCursor_ParmDecl10

A function or method parameter.

CXCursor_ObjCInterfaceDecl11

An Objective-C \@interface.

CXCursor_ObjCCategoryDecl12

An Objective-C \@interface for a category.

CXCursor_ObjCProtocolDecl13

An Objective-C \@protocol declaration.

CXCursor_ObjCPropertyDecl14

An Objective-C \@property declaration.

CXCursor_ObjCIvarDecl15

An Objective-C instance variable.

CXCursor_ObjCInstanceMethodDecl16

An Objective-C instance method.

CXCursor_ObjCClassMethodDecl17

An Objective-C class method.

CXCursor_ObjCImplementationDecl18

An Objective-C \@implementation.

CXCursor_ObjCCategoryImplDecl19

An Objective-C \@implementation for a category.

CXCursor_TypedefDecl20

A typedef.

CXCursor_CXXMethod21

A C++ class method.

CXCursor_Namespace22

A C++ namespace.

CXCursor_LinkageSpec23

A linkage specification, e.g. 'extern "C"'.

CXCursor_Constructor24

A C++ constructor.

CXCursor_Destructor25

A C++ destructor.

CXCursor_ConversionFunction26

A C++ conversion function.

CXCursor_TemplateTypeParameter27

A C++ template type parameter.

CXCursor_NonTypeTemplateParameter28

A C++ non-type template parameter.

CXCursor_TemplateTemplateParameter29

A C++ template template parameter.

CXCursor_FunctionTemplate30

A C++ function template.

CXCursor_ClassTemplate31

A C++ class template.

CXCursor_ClassTemplatePartialSpecialization32

A C++ class template partial specialization.

CXCursor_NamespaceAlias33

A C++ namespace alias declaration.

CXCursor_UsingDirective34

A C++ using directive.

CXCursor_UsingDeclaration35

A C++ using declaration.

CXCursor_TypeAliasDecl36

A C++ alias declaration

CXCursor_ObjCSynthesizeDecl37

An Objective-C \@synthesize definition.

CXCursor_ObjCDynamicDecl38

An Objective-C \@dynamic definition.

CXCursor_CXXAccessSpecifier39

An access specifier.

CXCursor_FirstDeclCXCursor_UnexposedDecl
CXCursor_LastDeclCXCursor_CXXAccessSpecifier
CXCursor_FirstRef40
CXCursor_ObjCSuperClassRef40
CXCursor_ObjCProtocolRef41
CXCursor_ObjCClassRef42
CXCursor_TypeRef43

A reference to a type declaration.

A type reference occurs anywhere where a type is named but not declared. For example, given:

\code typedef unsigned size_type; size_type size; \endcode

The typedef is a declaration of size_type (CXCursor_TypedefDecl), while the type of the variable "size" is referenced. The cursor referenced by the type of size is the typedef for size_type.

CXCursor_CXXBaseSpecifier44
CXCursor_TemplateRef45

A reference to a class template, function template, template template parameter, or class template partial specialization.

CXCursor_NamespaceRef46

A reference to a namespace or namespace alias.

CXCursor_MemberRef47

A reference to a member of a struct, union, or class that occurs in some non-expression context, e.g., a designated initializer.

CXCursor_LabelRef48

A reference to a labeled statement.

This cursor kind is used to describe the jump to "start_over" in the goto statement in the following example:

\code start_over: ++counter;

goto start_over; \endcode

A label reference cursor refers to a label statement.

CXCursor_OverloadedDeclRef49

A reference to a set of overloaded functions or function templates that has not yet been resolved to a specific function or function template.

An overloaded declaration reference cursor occurs in C++ templates where a dependent name refers to a function. For example:

\code template<typename T> void swap(T&, T&);

struct X { ... }; void swap(X&, X&);

template<typename T> void reverse(T* first, T* last) { while (first < last - 1) { swap(*first, *--last); ++first; } }

struct Y { }; void swap(Y&, Y&); \endcode

Here, the identifier "swap" is associated with an overloaded declaration reference. In the template definition, "swap" refers to either of the two "swap" functions declared above, so both results will be available. At instantiation time, "swap" may also refer to other functions found via argument-dependent lookup (e.g., the "swap" function at the end of the example).

The functions \c clang_getNumOverloadedDecls() and \c clang_getOverloadedDecl() can be used to retrieve the definitions referenced by this cursor.

CXCursor_VariableRef50

A reference to a variable that occurs in some non-expression context, e.g., a C++ lambda capture list.

CXCursor_LastRefCXCursor_VariableRef
CXCursor_FirstInvalid70
CXCursor_InvalidFile70
CXCursor_NoDeclFound71
CXCursor_NotImplemented72
CXCursor_InvalidCode73
CXCursor_LastInvalidCXCursor_InvalidCode
CXCursor_FirstExpr100
CXCursor_UnexposedExpr100

An expression whose specific kind is not exposed via this interface.

Unexposed expressions have the same operations as any other kind of expression; one can extract their location information, spelling, children, etc. However, the specific kind of the expression is not reported.

CXCursor_DeclRefExpr101

An expression that refers to some value declaration, such as a function, variable, or enumerator.

CXCursor_MemberRefExpr102

An expression that refers to a member of a struct, union, class, Objective-C class, etc.

CXCursor_CallExpr103

An expression that calls a function.

CXCursor_ObjCMessageExpr104

An expression that sends a message to an Objective-C object or class.

CXCursor_BlockExpr105

An expression that represents a block literal.

CXCursor_IntegerLiteral106

An integer literal.

CXCursor_FloatingLiteral107

A floating point number literal.

CXCursor_ImaginaryLiteral108

An imaginary number literal.

CXCursor_StringLiteral109

A string literal.

CXCursor_CharacterLiteral110

A character literal.

CXCursor_ParenExpr111

A parenthesized expression, e.g. "(1)".

This AST node is only formed if full location information is requested.

CXCursor_UnaryOperator112

This represents the unary-expression's (except sizeof and alignof).

CXCursor_ArraySubscriptExpr113

[C99 6.5.2.1] Array Subscripting.

CXCursor_BinaryOperator114

A builtin binary operation expression such as "x + y" or "x <= y".

CXCursor_CompoundAssignOperator115

Compound assignment such as "+=".

CXCursor_ConditionalOperator116

The ?: ternary operator.

CXCursor_CStyleCastExpr117

An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ expr.cast), which uses the syntax (Type)expr.

For example: (int)f.

CXCursor_CompoundLiteralExpr118

[C99 6.5.2.5]

CXCursor_InitListExpr119

Describes an C or C++ initializer list.

CXCursor_AddrLabelExpr120

The GNU address of label extension, representing &&label.

CXCursor_StmtExpr121

This is the GNU Statement Expression extension: ({int X=4; X;})

CXCursor_GenericSelectionExpr122

Represents a C11 generic selection.

CXCursor_GNUNullExpr123

Implements the GNU __null extension, which is a name for a null pointer constant that has integral type (e.g., int or long) and is the same size and alignment as a pointer.

The __null extension is typically only used by system headers, which define NULL as __null in C++ rather than using 0 (which is an integer that may not match the size of a pointer).

CXCursor_CXXStaticCastExpr124

C++'s static_cast<> expression.

CXCursor_CXXDynamicCastExpr125

C++'s dynamic_cast<> expression.

CXCursor_CXXReinterpretCastExpr126

C++'s reinterpret_cast<> expression.

CXCursor_CXXConstCastExpr127

C++'s const_cast<> expression.

CXCursor_CXXFunctionalCastExpr128

Represents an explicit C++ type conversion that uses "functional" notion (C++ expr.type.conv).

Example: \code x = int(0.5); \endcode

CXCursor_CXXTypeidExpr129

A C++ typeid expression (C++ expr.typeid).

CXCursor_CXXBoolLiteralExpr130

[C++ 2.13.5] C++ Boolean Literal.

CXCursor_CXXNullPtrLiteralExpr131

[C++0x 2.14.7] C++ Pointer Literal.

CXCursor_CXXThisExpr132

Represents the "this" expression in C++

CXCursor_CXXThrowExpr133

[C++ 15] C++ Throw Expression.

This handles 'throw' and 'throw' assignment-expression. When assignment-expression isn't present, Op will be null.

CXCursor_CXXNewExpr134

A new expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".

CXCursor_CXXDeleteExpr135

A delete expression for memory deallocation and destructor calls, e.g. "delete[] pArray".

CXCursor_UnaryExpr136

A unary expression. (noexcept, sizeof, or other traits)

CXCursor_ObjCStringLiteral137

An Objective-C string literal i.e. @"foo".

CXCursor_ObjCEncodeExpr138

An Objective-C \@encode expression.

CXCursor_ObjCSelectorExpr139

An Objective-C \@selector expression.

CXCursor_ObjCProtocolExpr140

An Objective-C \@protocol expression.

CXCursor_ObjCBridgedCastExpr141

An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers, transferring ownership in the process.

\code NSString *str = (__bridge_transfer NSString *)CFCreateString(); \endcode

CXCursor_PackExpansionExpr142

Represents a C++0x pack expansion that produces a sequence of expressions.

A pack expansion expression contains a pattern (which itself is an expression) followed by an ellipsis. For example:

\code template<typename F, typename ...Types> void forward(F f, Types &&...args) { f(static_cast<Types&&>(args)...); } \endcode

CXCursor_SizeOfPackExpr143

Represents an expression that computes the length of a parameter pack.

\code template<typename ...Types> struct count { static const unsigned value = sizeof...(Types); }; \endcode

CXCursor_LambdaExpr144
CXCursor_ObjCBoolLiteralExpr145

Objective-c Boolean Literal.

CXCursor_ObjCSelfExpr146

Represents the "self" expression in an Objective-C method.

CXCursor_OMPArraySectionExpr147

OpenMP 5.0 [2.1.5, Array Section].

CXCursor_ObjCAvailabilityCheckExpr148

Represents an @available(...) check.

CXCursor_FixedPointLiteral149

Fixed point literal

CXCursor_OMPArrayShapingExpr150

OpenMP 5.0 [2.1.4, Array Shaping].

CXCursor_OMPIteratorExpr151

OpenMP 5.0 [2.1.6 Iterators]

CXCursor_CXXAddrspaceCastExpr152

OpenCL's addrspace_cast<> expression.

CXCursor_ConceptSpecializationExpr153

Expression that references a C++20 concept.

CXCursor_RequiresExpr154

Expression that references a C++20 concept.

CXCursor_LastExprCXCursor_RequiresExpr
CXCursor_FirstStmt200
CXCursor_UnexposedStmt200

A statement whose specific kind is not exposed via this interface.

Unexposed statements have the same operations as any other kind of statement; one can extract their location information, spelling, children, etc. However, the specific kind of the statement is not reported.

CXCursor_LabelStmt201

A labelled statement in a function.

This cursor kind is used to describe the "start_over:" label statement in the following example:

\code start_over: ++counter; \endcode

CXCursor_CompoundStmt202

A group of statements like { stmt stmt }.

This cursor kind is used to describe compound statements, e.g. function bodies.

CXCursor_CaseStmt203

A case statement.

CXCursor_DefaultStmt204

A default statement.

CXCursor_IfStmt205

An if statement

CXCursor_SwitchStmt206

A switch statement.

CXCursor_WhileStmt207

A while statement.

CXCursor_DoStmt208

A do statement.

CXCursor_ForStmt209

A for statement.

CXCursor_GotoStmt210

A goto statement.

CXCursor_IndirectGotoStmt211

An indirect goto statement.

CXCursor_ContinueStmt212

A continue statement.

CXCursor_BreakStmt213

A break statement.

CXCursor_ReturnStmt214

A return statement.

CXCursor_GCCAsmStmt215

A GCC inline assembly statement extension.

CXCursor_AsmStmtCXCursor_GCCAsmStmt
CXCursor_ObjCAtTryStmt216

Objective-C's overall \@try-\@catch-\@finally statement.

CXCursor_ObjCAtCatchStmt217

Objective-C's \@catch statement.

CXCursor_ObjCAtFinallyStmt218

Objective-C's \@finally statement.

CXCursor_ObjCAtThrowStmt219

Objective-C's \@throw statement.

CXCursor_ObjCAtSynchronizedStmt220

Objective-C's \@synchronized statement.

CXCursor_ObjCAutoreleasePoolStmt221

Objective-C's autorelease pool statement.

CXCursor_ObjCForCollectionStmt222

Objective-C's collection statement.

CXCursor_CXXCatchStmt223

C++'s catch statement.

CXCursor_CXXTryStmt224

C++'s try statement.

CXCursor_CXXForRangeStmt225

C++'s for (* : *) statement.

CXCursor_SEHTryStmt226

Windows Structured Exception Handling's try statement.

CXCursor_SEHExceptStmt227

Windows Structured Exception Handling's except statement.

CXCursor_SEHFinallyStmt228

Windows Structured Exception Handling's finally statement.

CXCursor_MSAsmStmt229

A MS inline assembly statement extension.

CXCursor_NullStmt230

The null statement ";": C99 6.8.3p3.

This cursor kind is used to describe the null statement.

CXCursor_DeclStmt231

Adaptor class for mixing declarations with statements and expressions.

CXCursor_OMPParallelDirective232

OpenMP parallel directive.

CXCursor_OMPSimdDirective233

OpenMP SIMD directive.

CXCursor_OMPForDirective234

OpenMP for directive.

CXCursor_OMPSectionsDirective235

OpenMP sections directive.

CXCursor_OMPSectionDirective236

OpenMP section directive.

CXCursor_OMPSingleDirective237

OpenMP single directive.

CXCursor_OMPParallelForDirective238

OpenMP parallel for directive.

CXCursor_OMPParallelSectionsDirective239

OpenMP parallel sections directive.

CXCursor_OMPTaskDirective240

OpenMP task directive.

CXCursor_OMPMasterDirective241

OpenMP master directive.

CXCursor_OMPCriticalDirective242

OpenMP critical directive.

CXCursor_OMPTaskyieldDirective243

OpenMP taskyield directive.

CXCursor_OMPBarrierDirective244

OpenMP barrier directive.

CXCursor_OMPTaskwaitDirective245

OpenMP taskwait directive.

CXCursor_OMPFlushDirective246

OpenMP flush directive.

CXCursor_SEHLeaveStmt247

Windows Structured Exception Handling's leave statement.

CXCursor_OMPOrderedDirective248

OpenMP ordered directive.

CXCursor_OMPAtomicDirective249

OpenMP atomic directive.

CXCursor_OMPForSimdDirective250

OpenMP for SIMD directive.

CXCursor_OMPParallelForSimdDirective251

OpenMP parallel for SIMD directive.

CXCursor_OMPTargetDirective252

OpenMP target directive.

CXCursor_OMPTeamsDirective253

OpenMP teams directive.

CXCursor_OMPTaskgroupDirective254

OpenMP taskgroup directive.

CXCursor_OMPCancellationPointDirective255

OpenMP cancellation point directive.

CXCursor_OMPCancelDirective256

OpenMP cancel directive.

CXCursor_OMPTargetDataDirective257

OpenMP target data directive.

CXCursor_OMPTaskLoopDirective258

OpenMP taskloop directive.

CXCursor_OMPTaskLoopSimdDirective259

OpenMP taskloop simd directive.

CXCursor_OMPDistributeDirective260

OpenMP distribute directive.

CXCursor_OMPTargetEnterDataDirective261

OpenMP target enter data directive.

CXCursor_OMPTargetExitDataDirective262

OpenMP target exit data directive.

CXCursor_OMPTargetParallelDirective263

OpenMP target parallel directive.

CXCursor_OMPTargetParallelForDirective264

OpenMP target parallel for directive.

CXCursor_OMPTargetUpdateDirective265

OpenMP target update directive.

CXCursor_OMPDistributeParallelForDirective266

OpenMP distribute parallel for directive.

CXCursor_OMPDistributeParallelForSimdDirective267

OpenMP distribute parallel for simd directive.

CXCursor_OMPDistributeSimdDirective268

OpenMP distribute simd directive.

CXCursor_OMPTargetParallelForSimdDirective269

OpenMP target parallel for simd directive.

CXCursor_OMPTargetSimdDirective270

OpenMP target simd directive.

CXCursor_OMPTeamsDistributeDirective271

OpenMP teams distribute directive.

CXCursor_OMPTeamsDistributeSimdDirective272

OpenMP teams distribute simd directive.

CXCursor_OMPTeamsDistributeParallelForSimdDirective273

OpenMP teams distribute parallel for simd directive.

CXCursor_OMPTeamsDistributeParallelForDirective274

OpenMP teams distribute parallel for directive.

CXCursor_OMPTargetTeamsDirective275

OpenMP target teams directive.

CXCursor_OMPTargetTeamsDistributeDirective276

OpenMP target teams distribute directive.

CXCursor_OMPTargetTeamsDistributeParallelForDirective277

OpenMP target teams distribute parallel for directive.

CXCursor_OMPTargetTeamsDistributeParallelForSimdDirective278

OpenMP target teams distribute parallel for simd directive.

CXCursor_OMPTargetTeamsDistributeSimdDirective279

OpenMP target teams distribute simd directive.

CXCursor_BuiltinBitCastExpr280

C++2a std::bit_cast expression.

CXCursor_OMPMasterTaskLoopDirective281

OpenMP master taskloop directive.

CXCursor_OMPParallelMasterTaskLoopDirective282

OpenMP parallel master taskloop directive.

CXCursor_OMPMasterTaskLoopSimdDirective283

OpenMP master taskloop simd directive.

CXCursor_OMPParallelMasterTaskLoopSimdDirective284

OpenMP parallel master taskloop simd directive.

CXCursor_OMPParallelMasterDirective285

OpenMP parallel master directive.

CXCursor_OMPDepobjDirective286

OpenMP depobj directive.

CXCursor_OMPScanDirective287

OpenMP scan directive.

CXCursor_OMPTileDirective288

OpenMP tile directive.

CXCursor_OMPCanonicalLoop289

OpenMP canonical loop.

CXCursor_OMPInteropDirective290

OpenMP interop directive.

CXCursor_OMPDispatchDirective291

OpenMP dispatch directive.

CXCursor_OMPMaskedDirective292

OpenMP masked directive.

CXCursor_OMPUnrollDirective293

OpenMP unroll directive.

CXCursor_OMPMetaDirective294

OpenMP metadirective directive.

CXCursor_OMPGenericLoopDirective295

OpenMP loop directive.

CXCursor_OMPTeamsGenericLoopDirective296

OpenMP teams loop directive.

CXCursor_OMPTargetTeamsGenericLoopDirective297

OpenMP target teams loop directive.

CXCursor_OMPParallelGenericLoopDirective298

OpenMP parallel loop directive.

CXCursor_OMPTargetParallelGenericLoopDirective299

OpenMP target parallel loop directive.

CXCursor_OMPParallelMaskedDirective300

OpenMP parallel masked directive.

CXCursor_OMPMaskedTaskLoopDirective301

OpenMP masked taskloop directive.

CXCursor_OMPMaskedTaskLoopSimdDirective302

OpenMP masked taskloop simd directive.

CXCursor_OMPParallelMaskedTaskLoopDirective303

OpenMP parallel masked taskloop directive.

CXCursor_OMPParallelMaskedTaskLoopSimdDirective304

OpenMP parallel masked taskloop simd directive.

CXCursor_LastStmtCXCursor_OMPParallelMaskedTaskLoopSimdDirective
CXCursor_TranslationUnit350

Cursor that represents the translation unit itself.

The translation unit cursor exists primarily to act as the root cursor for traversing the contents of a translation unit.

CXCursor_FirstAttr400
CXCursor_UnexposedAttr400

An attribute whose specific kind is not exposed via this interface.

CXCursor_IBActionAttr401
CXCursor_IBOutletAttr402
CXCursor_IBOutletCollectionAttr403
CXCursor_CXXFinalAttr404
CXCursor_CXXOverrideAttr405
CXCursor_AnnotateAttr406
CXCursor_AsmLabelAttr407
CXCursor_PackedAttr408
CXCursor_PureAttr409
CXCursor_ConstAttr410
CXCursor_NoDuplicateAttr411
CXCursor_CUDAConstantAttr412
CXCursor_CUDADeviceAttr413
CXCursor_CUDAGlobalAttr414
CXCursor_CUDAHostAttr415
CXCursor_CUDASharedAttr416
CXCursor_VisibilityAttr417
CXCursor_DLLExport418
CXCursor_DLLImport419
CXCursor_NSReturnsRetained420
CXCursor_NSReturnsNotRetained421
CXCursor_NSReturnsAutoreleased422
CXCursor_NSConsumesSelf423
CXCursor_NSConsumed424
CXCursor_ObjCException425
CXCursor_ObjCNSObject426
CXCursor_ObjCIndependentClass427
CXCursor_ObjCPreciseLifetime428
CXCursor_ObjCReturnsInnerPointer429
CXCursor_ObjCRequiresSuper430
CXCursor_ObjCRootClass431
CXCursor_ObjCSubclassingRestricted432
CXCursor_ObjCExplicitProtocolImpl433
CXCursor_ObjCDesignatedInitializer434
CXCursor_ObjCRuntimeVisible435
CXCursor_ObjCBoxable436
CXCursor_FlagEnum437
CXCursor_ConvergentAttr438
CXCursor_WarnUnusedAttr439
CXCursor_WarnUnusedResultAttr440
CXCursor_AlignedAttr441
CXCursor_LastAttrCXCursor_AlignedAttr
CXCursor_PreprocessingDirective500
CXCursor_MacroDefinition501
CXCursor_MacroExpansion502
CXCursor_MacroInstantiationCXCursor_MacroExpansion
CXCursor_InclusionDirective503
CXCursor_FirstPreprocessingCXCursor_PreprocessingDirective
CXCursor_LastPreprocessingCXCursor_InclusionDirective
CXCursor_ModuleImportDecl600

A module import declaration.

CXCursor_TypeAliasTemplateDecl601
CXCursor_StaticAssert602

A static_assert or _Static_assert node

CXCursor_FriendDecl603

a friend declaration.

CXCursor_ConceptDecl604

a concept declaration.

CXCursor_FirstExtraDeclCXCursor_ModuleImportDecl
CXCursor_LastExtraDeclCXCursor_ConceptDecl
CXCursor_OverloadCandidate700

A code completion overload candidate.

Meta