<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Dec 22, 2011, at 1:57 AM, Peter wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; position: static; z-index: auto; "><div>Hi everybody,</div><div><br></div><div>I am using Version 3.0 and I am trying to parse the parameter of the following function declaration. <br></div><div><br></div><div>void test(int myParam[])</div>
<div>{</div>
<div><br>
</div>
<div><br>
</div>
<div>}</div><div><br></div><div>I have written an ASTVisitor to iterate over the "ParamDecl's"of my "FunctionDecl's"</div><div>The type of the "ParmVarDecl" myParam is always a "PointerType", although I am expecting</div><div>an "ArrayType". Is this normal behavior?</div></div></div></blockquote><div><br></div>Yes. The language specifies that parameters of array or function type are adjusted to the corresponding pointer type.</div><div><br><blockquote type="cite"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; position: static; z-index: auto; ">Also when I parse the following code I am loosing the size information. Sure, the<br>99 doesn't make much sense, but I need it for internal analysis ;)<br><br><div>void test(int myParam[99])</div>
<div>{</div>
<div><br>
</div>
<div><br>
</div>
<div>}</div>
<div><br></div><div>I hope someone can help!</div></div></div></blockquote><br></div><div>Use ParmVarDecl::getOriginalType() to get the type as it was spelled in the source code, before the adjustment applied.</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>- Doug</div><br></body></html>