This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Possible scoping bug?
- To: egcs-bugs at cygnus dot com
- Subject: Possible scoping bug?
- From: njs3 at doc dot ic dot ac dot uk (Niall Smart)
- Date: Sun, 24 May 1998 19:13:50 +0100
Hi,
The following code fails to compile; but I'm not sure if it should:
1 struct foo {
2 int x;
3 };
4
5 int main()
6 {
7 foo* foo;
8
9 foo = (foo*) 0;
10 }
[njs3@cnet0000 ~]$ g++ --version; g++ foo.cc
egcs-2.91.29
foo.cc: In function `int main()':
foo.cc:9: parse error before `)'
Changing line 9 to
foo = (::foo*) 0;
or
foo = (struct foo*) 0;
makes it work. Is this necessary?
Niall