[cfe-commits] r56060 - /cfe/trunk/lib/Parse/ParseStmt.cpp

Neil Booth neil at daikokuya.co.uk
Thu Sep 11 15:33:51 PDT 2008


Argiris Kirtzidis wrote:-

> But it says that for your example:
>
> void f(void)
> {
>  int x; #1
>
>  if (int x = 1) #2
>  {
>  }
> }
>
>
> #2 is local to the if statement, so it doesn't collide with #1.

Hmm, I guess that is the meaning.  It seems strange that it isn't
just explicitly stated like in C99.  Once you start reading about
scopes and declarative regions, it only gets more confusing.

> 3.3.2p4 says that #2 is local to the if statement, and 6.4p3 says that #2 goes out of scope when the if statement finishes.
> Are you suggesting that we handle these requirements for #2 without entering a new scope ?

As I initially read the standard, yes, but I think you've persuaded
me the standard does require a new scope.

Neil.



More information about the cfe-commits mailing list