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]

nested template misclassified


In the following bug report,  the compiler misclassifies
SubjVec<SubjTest>::Curry as not a template
-------------- cut here --------------------
cd /home/evansl/prog_dev/gcc_all/gcc-2.96/tests/CurryTmpl/
make
uname -a
Linux localhost.localdomain 2.2.13-4mdk #1 Tue Sep 7 18:23:11 CEST 1999
i586 unknown
g++ -v
Reading specs from
/home/evansl/prog_dev/gcc_all/dist/lib/gcc-lib/i586-pc-linux-gnu/2.96/specs

gcc version 2.96 20000520 (experimental)
g++ -E bugSubjVec.cpp
# 1 "bugSubjVec.cpp"
template
  < template <typename SB,typename GF>class ELEM_SUBJ
  >
  struct
SubjVec
  {
    template<typename CONT_BASE,typename GC_FLAG>
      struct
    Curry
      : public ELEM_SUBJ<CONT_BASE,GC_FLAG>
      {
      };
  };

struct GcFlag

  {
    struct
  OffsetYes

    {
        typedef
      OffsetYes
    Next
      ;
    };
    struct
  OffsetNo

    {
        typedef
      OffsetNo
    Next
      ;
    };
    struct
  RootProx
    {
        typedef
      OffsetNo
    Next
      ;
    };
    struct
  RootSubj
    {
        typedef
      RootProx
    Next
      ;
    };
  };

template
  < typename SUBJ_BASE
  , typename GC_FLAG=GcFlag::RootSubj
  >
  struct
SubjRec
  : public SUBJ_BASE

  {
  };

        typedef
      int
    OffsetsSubjProxies
      ;

  struct
StkProxPushPtr
  {
        typedef
      unsigned
    PushCountType
      ;
  };

template
  < typename SUBJ_BASE
  , typename GC_FLAG
  >
  struct
SubjOff
  : public SubjRec<SUBJ_BASE,GC_FLAG>
  {
  };

  struct
SubjBaseCrc
  {
  };

template
  < typename SUBJ_BASE
  , typename GC_FLAG
  >
  struct
SubjTest
  : public SubjOff<SUBJ_BASE,GC_FLAG>
  {
        typedef
      SubjOff<SUBJ_BASE,GC_FLAG>
    SuperType
      ;
        typedef
      SubjTest<SUBJ_BASE,GC_FLAG>
    ThisType
      ;
      OffsetsSubjProxies const&
    get_offsets(void)const
      ;
  };
template
  < template< typename SUBJ_BASE, typename GC_FLAG>class SUBJ_TMPL
  >
  struct
TmplTmplPara
  { SUBJ_TMPL<SubjBaseCrc,GcFlag::RootSubj> m_subj;
  };
  int
main(void)
  { bool result=false

  ; {
    ; TmplTmplPara<SubjVec<SubjTest>::Curry> b_subj
    ; result=result && &b_subj
    ;}

  ; return result
  ;}
../../bin/g++ -c -Wall bugSubjVec.cpp
bugSubjVec.cpp: In instantiation of
`TmplTmplPara<SubjVec<SubjTest>::Curry>':
bugSubjVec.cpp:127:   instantiated from here
bugSubjVec.cpp:119: `Curry' is not a template***
make: *** [compile] Error 1

Compilation exited abnormally with code 2 at Fri May 26 14:18:09



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