Skip to main content

adjust_parameter

Function adjust_parameter 

Source
pub fn adjust_parameter(types: &mut Types, id: TypeId) -> TypeId
Expand description

The type a parameter declared as id really has, 6.7.6.3p7 and p8.

An array parameter is a pointer to its element and a function parameter is a pointer to the function, which is why int f(int a[3]) and int f(int *a) declare the same function. The qualifiers on the outermost node go too, so void f(const int) and void f(int) do as well: a const there is a promise the function makes to itself and not part of its type.

FunctionType::params is defined to hold types this has already been applied to, so this belongs to whoever builds the type out of a declarator rather than to the comparison below.