I am using Version 3.0 and I am trying to parse the parameter of the following function declaration.
void test(int myParam[])
{
}
I have written an ASTVisitor to iterate over the "ParamDecl’s"of my “FunctionDecl’s”
The type of the “ParmVarDecl” myParam is always a “PointerType”, although I am expecting
an “ArrayType”. Is this normal behavior?
Also when I parse the following code I am loosing the size information. Sure, the
99 doesn’t make much sense, but I need it for internal analysis
I am using Version 3.0 and I am trying to parse the parameter of the following function declaration.
void test(int myParam[])
{
}
I have written an ASTVisitor to iterate over the "ParamDecl’s"of my “FunctionDecl’s”
The type of the “ParmVarDecl” myParam is always a “PointerType”, although I am expecting
an “ArrayType”. Is this normal behavior?
Yes. The language specifies that parameters of array or function type are adjusted to the corresponding pointer type.
Also when I parse the following code I am loosing the size information. Sure, the
99 doesn’t make much sense, but I need it for internal analysis
void test(int myParam[99])
{
}
I hope someone can help!
Use ParmVarDecl::getOriginalType() to get the type as it was spelled in the source code, before the adjustment applied.