<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi, Fritz. A DeclStmt can have more than one Decl in it...</div><div><br></div><div>int a, *b, c = 3;</div><div><br></div><div>...so you'll have to iterate over the Decls within it using decl_begin() and decl_end(). And since not all Decls have names, you'll then have to dyn_cast* each one to a NamedDecl before printing any names.</div><div><br></div><div>*It's possible that all Decls found in a DeclStmt <i>will</i> have names, in which case you can just use the asserting 'cast' instead of 'dyn_cast'.</div><div><br></div><div>Hope that helps,</div><div>Jordan</div><div><br></div><br><div><div>On Dec 21, 2012, at 2:48 , Fritz Franz <<a href="mailto:antonmaier40@gmail.com">antonmaier40@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi, please could anybody help me?<br><br>I have a DeclStmt and I would like to find out the name of the variable that<br>is declared.<br><br>Thanks,<br>best regards<br>Fritz Franz<br><br><br><br>--<br>View this message in context: <a href="http://clang-developers.42468.n3.nabble.com/How-to-find-out-name-of-variable-of-a-given-DeclStmt-tp4029123.html">http://clang-developers.42468.n3.nabble.com/How-to-find-out-name-of-variable-of-a-given-DeclStmt-tp4029123.html</a><br>Sent from the Clang Developers mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.<br>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev<br></blockquote></div><br></body></html>