This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15359] errors specializing a template class of a template class
- From: "igodard at pacbell dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 May 2004 19:37:08 -0000
- Subject: [Bug c++/15359] errors specializing a template class of a template class
- References: <20040509235749.15359.igodard@pacbell.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From igodard at pacbell dot net 2004-05-10 19:37 -------
But that doesn't work either (or rather it does, but it's not my case). My case is (using your suggested code):
template<typename E>
struct F {
template<typename G>
struct H {
};
H<E> h;
};
template<>
template<typename E>
struct F<E>::H<int> {
public:
int i;
};
int main() {
return 0;
}
That is, no matter what the template argument E to the outer template H is, I want the inner template H to specialize as specified when invoked with argument G as int. Note that the inner template does not depend in any way on either the outer template or its argiment. My reading of the standard says that this is legal (though I admit it is impossible to tell for the merely mortal), and gcc is not accepting it - nor any of the other constructions I've tried.
Is the above code actually legal? If not, is there a way to get the semantics I'm looking for? The obvious approach of simply making the specialization of H local to G (and so using whatever E is present) seems to be rejected, although for the life of me I can't guess why that would be so.
Ivan
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15359