This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/3825: Problems in instantiation of generic members.
- From: Nathanael Nerode <neroden at twcny dot rr dot com>
- To: gdr at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, fasbjx at free dot fr
- Date: Fri, 3 Jan 2003 07:42:48 -0500
- Subject: Re: c++/3825: Problems in instantiation of generic members.
- Reply-to: neroden at twcny dot rr dot com
I believe the code given is substantially wrong. Consider, however, the
following testcase:
---
template< typename X, typename Y, int = 1 >
struct C1 {
template< int, int >
struct C2 {
enum { v = 0 };
};
};
enum Xx { a, b, c, d };
template <> template <>
struct C1< Xx, Xx >::C2< a, a > {
enum { v = 1 };
};
template< typename X >
struct D: public C1< X, X, 5 > {
template< int, int > struct C2 {
enum { v = 2 };
};
#include <iostream>
int main() {
std::cout << D< Xx >::C2< a, a >::v << std::endl;
// And the next case...
std::cout << C1< Xx, Xx >::C2< a, a >::v << std::endl;
}
---
This compiles perfectly and gives correct results.
So I'm guessing this can be closed...
Do I need to add a testcase for this, or are there enough already?