[cfe-dev] can we know if an array definition has an explicit size ??

Sean Silva silvas at purdue.edu
Sun Jan 6 00:09:14 PST 2013


You can probably check that it is a ConstantArrayType
<http://clang.llvm.org/doxygen/classclang_1_1ConstantArrayType.html>.

-- Sean Silva

On Sun, Jan 6, 2013 at 1:10 AM, kevinlynx <kevinlynx at gmail.com> wrote:
> say,
>
>     int arr[] = { 1, 2, 3 }
>
> here `arr` size is determined by the initializer expression automatically,
> but how to know this ? I implement `RecursiveASTVisitor::VisitVarDecl` and
> get a `VarDecl` object.
>
> Thanks
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>



More information about the cfe-dev mailing list