question about tree format

Dennis Dams dennis@research.bell-labs.com
Mon Feb 11 16:30:00 GMT 2002


This is a question about the tree format, the intermediate
representation used by GCC (Ch. 18 of manual).
(I'm using GCC 3.0.1)

For a declaration like

struct TAG { int i; } r;

gcc produces a different chain of decl nodes in the tree, depending on 
whether the declaration occurs inside a scope or not.

On the outermost (file) level, it leads to a chain of
first a type_decl for the tagged record_type,
then a var_decl for r.

Inside a scope, the type_decl for the tagged record_type is missing
if (and only if) the declaration is the first inside the scope.

Is there any logic behind this irregularity?

thanks for any help,
--dennis.



More information about the Gcc mailing list