<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Mar 4, 2011, at 3:31 AM, Talespin Kit wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><table cellspacing="0" cellpadding="0" border="0" style="position: static; z-index: auto; "><tbody><tr><td valign="top" style="font: inherit;"><div>Assume the follwing code</div>
<div> </div>
<div>class A</div>
<div>{</div>
<div> public:</div>
<div> enum E { // E is EnumDecl</div>
<div> ec1, // EnumConstantDecl</div>
<div> ec2</div>
<div> };</div>
<div> </div>
<div> void foo()</div>
<div> {</div>
<div> E eVar = ec1; // this is a DeclStmt, but what is the type of eVar and ec1?</div>
<div> }</div>
<div>};</div>
<div> </div>
<div>In the above code we know that the line E eVar = ec1; is a DeclStmt. What are the subcomponents of that.</div>
<div> </div>
<div>What is the type of ec1?.</div>
<div> </div></td></tr></tbody></table>
_______________________________________________<br></blockquote><div><table cellspacing="0" cellpadding="0" border="0" style="position: static; z-index: auto; "><tbody><tr><td valign="top" style="font: inherit;"><div><br></div><div><br></div></td></tr></tbody></table></div></div>The AST dump is a good way to see this information:<div><br></div><div><div>$ clang -cc1 -ast-dump t3.cpp </div><div>typedef __int128_t __int128_t;</div><div>typedef __uint128_t __uint128_t;</div><div>struct __va_list_tag {</div><div> struct __va_list_tag;</div><div> unsigned int gp_offset;</div><div> unsigned int fp_offset;</div><div> void *overflow_arg_area;</div><div> void *reg_save_area;</div><div>};</div><div>typedef struct __va_list_tag __va_list_tag;</div><div>typedef __va_list_tag __builtin_va_list[1];</div><div>class A {</div><div> class A;</div><div>public:</div><div> enum E {</div><div> ec1,</div><div> ec2</div><div> };</div><div> void foo() (CompoundStmt 0x101843320 <t3.cpp:10:8, line:12:8></div><div> (DeclStmt 0x101843300 <line:11:16, col:28></div><div> 0x101843280 "A::E eVar =</div><div> (DeclRefExpr 0x1018432d0 <col:25> 'enum A::E' EnumConstant='ec1' 0x1018430f0)"))</div><div><br></div><div><br></div><div>};</div></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>- Doug</div></body></html>