[Bug c++/25922] New: Incomplete type with embedded member template struct

dmitrii dot kamenetskii at boeing dot com gcc-bugzilla@gcc.gnu.org
Mon Jan 23 11:23:00 GMT 2006


Hi,

Here is my complaint:

The problem encountered under Linux x86_64 platform...

The following test code fails to compile with the dignostics:

'AAA<3>::member' has incomplete type

============================================================
//Test code:

template<typename _A>
struct A
{
  template<typename _B> // Type--mapping struct
  struct B
  { typedef _B C; };
};

template<int _I>
class USERTYPE
{
public:
  int member[_I];
};

template<int _I>
class AAA
{
public:
   static iconst int  I=_I;
  typedef USERTYPE<I> T1;
  typedef  typename A<T1>::B<double>::C NEWTYPE;
  NEWTYPE member;       
};

int main()
{
  AAA<3> object;
  return 0;
}

On the other hand it compliles OK if 
   typedef USERTYPE<3> T1;  
is explicitely used above...

Is there anything syntaxically wrong with such a construction?
If it is acompiler bug is there any reasonable workaround.

Thank you.


-- 
           Summary: Incomplete type with embedded member template struct
           Product: gcc
           Version: 3.2.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dmitrii dot kamenetskii at boeing dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25922



More information about the Gcc-bugs mailing list