This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/21537] New: A templatized struct's member function can't call another templatized struct's templatized member function
- From: "mrstephengross at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 May 2005 19:28:27 -0000
- Subject: [Bug c++/21537] New: A templatized struct's member function can't call another templatized struct's templatized member function
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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