This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

Re: c++/7008: unexpected error message "var was not declared in this scope"


Synopsis: unexpected error message "var was not declared in this scope"

State-Changed-From-To: closed->analyzed
State-Changed-By: lerdsuwa
State-Changed-When: Sat Jul 13 02:41:36 2002
State-Changed-Why:
    PR reopened due to inconsistent behavior between ordinary
    and template functions:
     const int N = 500;
     
     void f(int var) {
         const int N = 5;
         struct { char str[N]; } zz;
         cout << "sizeof(zz) = " << sizeof(zz) << endl;
     }
     template <class T> void g(T var) {
         const int N = 5;
         struct { char str[N]; } zz;
         cout << "sizeof(zz) = " << sizeof(zz) << endl;
     }
     int main() { f(1); g(1); }
     

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7008


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