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

Journeyer J. Joh oosaprogrammer at gmail.com
Sun Jan 6 16:28:35 PST 2013


Hello Sean Silva, kevinlynx

In my previous study,
- an AST node of an array is composed of clang::TypeSourceInfo and identifier.
- clang::TypeSourceInfo is composed of clang::Type and clang::TypeLoc.
- identifier is the name of the array(variable).

Best regards
Journeyer

PS. This is not a proven info but just one of my study result.

2013/1/6 Sean Silva <silvas at purdue.edu>:
> On Sun, Jan 6, 2013 at 3:59 AM, kevinlynx <kevinlynx at gmail.com> wrote:
>> On the other hand, can you explan what a `TypeSourceInfo` is ?  I check out
>> the class comments, but still don't get the meaning. And what a `canonical`
>> is ? Thanks a lot.
>
> Yes, the name is pretty confusing. Basically, it is "extra
> information" about a type which doesn't factor into the core type
> checking code. E.g.,
>
> char arr[4 + 4];
>
> and
>
> char arr2[8];
>
> are the same type (Type) to the compiler, but there is a distinction
> that you can recover by looking at the TypeSourceInfo.
>
> -- Sean Silva
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev



-- 
----------------------------------------
Journeyer J. Joh
o o s a p r o g r a m m e r
a t
g m a i l  d o t  c o m
----------------------------------------



More information about the cfe-dev mailing list