You mean I cann't get scope information right now ?   <br><div><div><br></div><div style="font-size: 12px;font-family: Arial Narrow;padding:2px 0 2px 0;">------------------ Original ------------------</div><div style="font-size: 12px;background:#efefef;padding:8px;"><div><b>From: </b> "John McCall"<rjmccall@apple.com>;</div><div><b>Date: </b> Fri, Jan 11, 2013 04:22 PM</div><div><b>To: </b> "kevinlynx"<kevinlynx@gmail.com>; <wbr></div><div><b>Cc: </b> "cfe-dev"<cfe-dev@cs.uiuc.edu>; <wbr></div><div><b>Subject: </b> Re: [cfe-dev] which class represent variable scope ?</div></div><div><br></div>On Jan 10, 2013, at 9:05 PM, kevinlynx <kevinlynx@gmail.com> wrote:<br>> For example:<br>> <br>>     void func() {<br>>         unsigned a;<br>>         {<br>>              unsigned b;<br>>         }<br>>    }<br>> <br>> I want to know whether `a` and `b` is in the same code scope.  DeclContext does NOT work on this, which means `a` and `b` have the same DeclContext (a function decl context). I googled and found someone have already asked this question but didn't get an answer. <br><br>Scope is not recorded directly in the AST.  It would be both possible and reasonable to provide an API that recomputes the language-specific notion of the scope of each declaration in a function.<br><br>John.<br></div>