This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c++/2288: Redereclaration not diagnosed.



>Number:         2288
>Category:       c++
>Synopsis:       Redereclaration not diagnosed.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          accepts-illegal
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 14 06:56:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Gabriel Dos Reis, from a discussion on fr.comp.lang.c++
>Release:        gcc-2.95 and gcc-3_0 are affected
>Organization:
>Environment:
Immaterial
>Description:
g++ fails to diagnose the program construct below.
The redeclaration in the controled-statement is ill-formed
as per 3.3.2/4.
>How-To-Repeat:
#include <iostream>

int main()
{
   for (int i = 0; i < 10; ++i)
     {
        int i = 5;
         std::cout << i << std::endl;
     }
  return 0;
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]