This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
class partial specialization error (might be g++'s)
- From: Rodolfo Lima <rodolfo at rodsoft dot org>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 01 Jul 2010 11:06:43 -0300
- Subject: class partial specialization error (might be g++'s)
Hi, I'm trying to compile the following code with no sucess (using
gcc-4.5.0):
// -----------------------------------
template <class T>
struct identity
{
typedef T type;
};
template <class T, typename T::type A>
struct foo {};
template <class T, T A>
struct foo<identity<T>, A> {};
int main()
{
foo<identity<int>,0> bar; // error here
}
// ----------------------------------
gcc fails with:
teste.cpp:18:23: error: aggregate ‘foo<identity<int>, 0> bar’ has
incomplete type and cannot be defined
If I comment out the partial specialization, it compiles.
Since foo is nowhere incomplete, why does the error say so?
Who's to blame, me or g++?
Thanks in advance and best regards,
Rodolfo Lima