enum Sema::AssignConvertType

Description

AssignConvertType - All of the 'assignment' semantic checks return this enum to indicate whether the assignment was allowed. These checks are done for simple assignments, as well as initialization, return from function, argument passing, etc. The query is phrased in terms of a source and destination type.

Declared at: clang/include/clang/Sema/Sema.h:11987

Enumerators

NameValueComment
Compatible0Compatible - the types are compatible according to the standard.
PointerToInt1PointerToInt - The assignment converts a pointer to an int, which we accept as an extension.
IntToPointer2IntToPointer - The assignment converts an int to a pointer, which we accept as an extension.
FunctionVoidPointer3FunctionVoidPointer - The assignment is between a function pointer and void*, which the standard doesn't allow, but we accept as an extension.
IncompatiblePointer4IncompatiblePointer - The assignment is between two pointers types that are not compatible, but we accept them as an extension.
IncompatibleFunctionPointer5IncompatibleFunctionPointer - The assignment is between two function pointers types that are not compatible, but we accept them as an extension.
IncompatiblePointerSign6IncompatiblePointerSign - The assignment is between two pointers types which point to integers which have a different sign, but are otherwise identical. This is a subset of the above, but broken out because it's by far the most common case of incompatible pointers.
CompatiblePointerDiscardsQualifiers7CompatiblePointerDiscardsQualifiers - The assignment discards c/v/r qualifiers, which we accept as an extension.
IncompatiblePointerDiscardsQualifiers8IncompatiblePointerDiscardsQualifiers - The assignment discards qualifiers that we don't permit to be discarded, like address spaces.
IncompatibleNestedPointerAddressSpaceMismatch9IncompatibleNestedPointerAddressSpaceMismatch - The assignment changes address spaces in nested pointer types which is not allowed. For instance, converting __private int ** to __generic int ** is illegal even though __private could be converted to __generic.
IncompatibleNestedPointerQualifiers10IncompatibleNestedPointerQualifiers - The assignment is between two nested pointer types, and the qualifiers other than the first two levels differ e.g. char ** -> const char **, but we accept them as an extension.
IncompatibleVectors11IncompatibleVectors - The assignment is between two vector types that have the same size, which we accept as an extension.
IntToBlockPointer12IntToBlockPointer - The assignment converts an int to a block pointer. We disallow this.
IncompatibleBlockPointer13IncompatibleBlockPointer - The assignment is between two block pointers types that are not compatible.
IncompatibleObjCQualifiedId14IncompatibleObjCQualifiedId - The assignment is between a qualified id type and something else (that is incompatible with it). For example, "id <XXX>" = "Foo *", where "Foo *" doesn't implement the XXX protocol.
IncompatibleObjCWeakRef15IncompatibleObjCWeakRef - Assigning a weak-unavailable object to an object with __weak qualifier.
Incompatible16Incompatible - We reject this conversion outright, it is invalid to represent it in the AST.