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

Reply via email to