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]

[Bug c++/14177] New: class forward declaration and typename are conflicting ?


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


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