This is GCC Bugzilla
This is GCC Bugzilla Version 2.20+
View Bug Activity | Format For Printing | Clone This Bug
1 namespace Foo { 2 }; 3 4 class Foo { 5 }; 6 7 int main() { 8 class Foo1 : public Foo { 9 }; 10 Foo1 my_Foo1; 11 Foo my_foo; 12 return 0; 13 } 14 15 Foo.C: In function 'int main()': Foo.C:11: error: expected primary-expression before 'my_foo' Foo.C:11: error: expected `;' before 'my_foo' on line 8 and 10, "Foo" is understod asa class name, on line 11 as a namespace Without line 11, no error message at all
Subject: Re: New: name conflict between class and namespace name is not recognized "ulrich dot lauther at siemens dot com" <gcc-bugzilla@gcc.gnu.org> writes: | 1 namespace Foo { | 2 }; | 3 | 4 class Foo { | 5 }; | 6 | 7 int main() { | 8 class Foo1 : public Foo { | 9 }; | 10 Foo1 my_Foo1; | 11 Foo my_foo; | 12 return 0; | 13 } | 14 | 15 | Foo.C: In function 'int main()': | Foo.C:11: error: expected primary-expression before 'my_foo' | Foo.C:11: error: expected `;' before 'my_foo' | | on line 8 and 10, "Foo" is understod asa class name, on line 11 as a namespace | Without line 11, no error message at all Line 4 is invalid; the front-end should have issued a diagnostic there. -- Gaby
PR 2708 dup?
Resolved by r124960 (cf. http://gcc.gnu.org/ml/gcc-patches/2007-05/msg01182.html).
*** Bug 2708 has been marked as a duplicate of this bug. ***
*** Bug 33287 has been marked as a duplicate of this bug. ***
*** Bug 36709 has been marked as a duplicate of this bug. ***