[Bug c++/14497] New: Accepts invalid specialization of member template missing "template<>"
giovannibajo at libero dot it
gcc-bugzilla@gcc.gnu.org
Tue Mar 9 01:17:00 GMT 2004
----------------------------------
template <int N>
struct A {
template<int M> void B () ;
};
// template <> template <>
void A<0>::B<0>()
{
}
----------------------------------
This code snippet should be rejected because it is invalid (the two
specialization headers 'template <>' are commented), but it does not and it is
silently accepted.
The problem *appears* to be in pt.c:maybe_check_template_type:
if (template_header_count <= context_depth)
/* This is OK; the template headers are for the context. We
are actually too lenient here; like
check_explicit_specialization we should consider the number
of template types included in the actual declaration.
but I'm not sure.
--
Summary: Accepts invalid specialization of member template
missing "template<>"
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Keywords: accepts-invalid
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: giovannibajo at libero dot it
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14497
More information about the Gcc-bugs
mailing list