This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14177] New: class forward declaration and typename are conflicting ?
- From: "dfredoui at irisa dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Feb 2004 14:15:11 -0000
- Subject: [Bug c++/14177] New: class forward declaration and typename are conflicting ?
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
I don't really know if it is a bug or a strange feature of C++ ...
The problem is that the following code do not compile, which prevent to forward
declare some types without entering in the implementation of the class:
------------------------>>
struct Foo{
// declaration part
class foo1_t;// forward declaration of foo1_t
class foo2_t;// forward declaration of foo2_t
// implementation part
class foo1_t{};// declaration of foo1_t (no problem)
typedef foo1_t foo2_t;// declaration of foo2_t (do not compile)
};
<<------------------------
The error is the following:
>>------------------------
bug.cpp:8: duplicate nested type `Foo::foo2_t'
<<------------------------
--
Summary: class forward declaration and typename are conflicting ?
Product: gcc
Version: 3.2.2
Status: UNCONFIRMED
Severity: minor
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dfredoui at irisa dot fr
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14177