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++/21537] New: A templatized struct's member function can't call another templatized struct's templatized member function


In the following code, one templatized struct's member function calls another 
templatized struct's templatized member function. GCC 3.3.3 reports a parse 
error in the line labeled "This doesn't work!". I've found that if I change the 
instantiation of struct inner to use an 'int' rather than 'T', GCC will 
compile. Is this correct behavior, or is it a GCC bug?

===== CODE FOLLOWS =====

template<typename A>
struct inner
{
  template<typename B> void test() { }
};
  
template<typename T>
struct outer
{
  void go()
  {
//    inner<int> ().test<int>(); // This works!
    inner<T> ().test<int>(); // This doesn't work!
  }
}; 

===== END OF CODE =====

-- 
           Summary: A templatized struct's member function can't call
                    another templatized struct's templatized member function
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mrstephengross at hotmail dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


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