This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/19487] [3.3/3.4/4.0 Regression] map with a class template + method template fails to compile.
- From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Jan 2005 15:16:09 -0000
- Subject: [Bug c++/19487] [3.3/3.4/4.0 Regression] map with a class template + method template fails to compile.
- References: <20050117173442.19487.douze@enseeiht.fr>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From reichelt at gcc dot gnu dot org 2005-01-18 15:16 -------
Further reduced testcase:
==================================================
template<int> struct A
{
enum { e };
template<int> void foo();
};
template<> template<int> void A<0>::foo() {}
==================================================
This is probably the same underlying problem as in PR14494.
PR14494 can be reduced to
==================================================
template<int> struct A
{
template<int> void foo();
};
template<> template<int N> void A<0>::foo<N>() {}
==================================================
which results in the following bogus error message:
PR14494A.cc:10: error: function template partial specialization 'foo<N>' is not
allowed
PR14494A.cc:10: error: no 'void A<0>::foo()' member function declared in class
'A<0>'
PR14494A.cc:10: error: invalid function declaration
A similar version is the following:
==================================================
template<int> struct A
{
template<int> void foo();
};
template<> template<int> void A<0>::foo() {}
==================================================
which results in the following bogus error message:
PR14494B.cc:10: error: template-id 'foo<>' for 'void A<0>::foo()' does not match
any template declaration
PR14494B.cc:10: error: invalid function declaration
Btw, the underlying problem is not a regression.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |reichelt at gcc dot gnu dot
| |org
BugsThisDependsOn| |14494
Keywords| |monitored
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19487