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++/15503] New: nested template problem


For the following code, the compilation fails at the NProperty constructor.  I 
have tried numerous ways of naming the inherited constructor, none of which 
compile in gcc 3.4.  This compiles with gcc 3.3.3 but not with gcc 3.4. 
 
Thanks 
 
-------------------------------- 
class I { 
public: 
  class Type; 
  template<class T> class Object; 
}; 
 
class I::Type { 
public: 
  class Property; 
}; 
 
template<class T> 
class I::Object { 
public: 
  template<class D> class Property; 
}; 
 
class I::Type::Property { 
}; 
 
template<class T> 
template<class D> 
class I::Object<T>::Property : public I::Type::Property { 
public: 
  Property(D T::*d) : data(d) { } 
private: 
  D T::*data; 
}; 
 
class C : public I::Object<C> { 
public: 
  template<class T> class NProperty :  
    public I::Object<T>::template Property<int> { 
  public: 
    NProperty(int T::*d); 
  }; 
}; 
 
template<class T> 
C::NProperty<T>::NProperty(int T::*d) : 
  I::Object<T>::template Property<int>(d) { } 
 
int main() { 
  return 0; 
}

-- 
           Summary: nested template problem
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mark dot a dot anders at intel dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-gnu-linux
  GCC host triplet: i686-pc-gnu-linux
GCC target triplet: i686-pc-gnu-linux


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


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