scoping issue

Andrew Haley aph@redhat.com
Thu Sep 4 13:41:00 GMT 2008


Jason_Haynberg wrote:
> This strikes me as a bug.  What do you think?  
> It seems the first program should get the same error as the second?

Your first program is equivalent to

main()
{
  {
    int i;
    for (i = 0; i < 5; i++) {
      cout << i << endl;
      double i = 10.0;
      cout << i << endl;
    }
  }
}

Andrew.



More information about the Gcc-help mailing list