[cfe-dev] Type of Array ParmVarDecl becomes PointerType
Peter
clang_llvm_123-4 at yahoo.de
Thu Dec 22 11:54:52 PST 2011
>You can use ParmVarDecl::getOriginalType() if you really need
Yeahhhh... :):):):)
Doug,Eli thanks a lot!!!!!!!!!!!!!!!
________________________________
Von: Eli Friedman <eli.friedman at gmail.com>
An: Peter <clang_llvm_123-4 at yahoo.de>
Cc: "cfe-dev at cs.uiuc.edu" <cfe-dev at cs.uiuc.edu>
Gesendet: 18:05 Donnerstag, 22.Dezember 2011
Betreff: Re: [cfe-dev] Type of Array ParmVarDecl becomes PointerType
On Thu, Dec 22, 2011 at 1:57 AM, Peter <clang_llvm_123-4 at yahoo.de> wrote:
> Hi everybody,
>
> 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, that's how C works; for most purposes, the original type doesn't
matter. You can use ParmVarDecl::getOriginalType() if you really need
it.
-Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20111222/e76fb29a/attachment.html>
More information about the cfe-dev
mailing list