This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/7008: unexpected error message "var was not declared in this scope"
- From: lerdsuwa at gcc dot gnu dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, rdabrowa at poczta dot onet dot pl
- Date: 13 Jul 2002 09:41:37 -0000
- Subject: Re: c++/7008: unexpected error message "var was not declared in this scope"
- Reply-to: lerdsuwa at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, rdabrowa at poczta dot onet dot pl, gcc-gnats at gcc dot gnu dot org
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