This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/34834] New: Accepts invalid code for partial specializations.
- From: "sylvain dot pion at sophia dot inria dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Jan 2008 18:54:47 -0000
- Subject: [Bug c++/34834] New: Accepts invalid code for partial specializations.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following code is accepted by g++ (4.1, 4.3), while I think it is invalid.
-----------------------------
template <class T>
struct A {};
template <> // This line should be removed
template <class T>
struct A<T*> {};
int main()
{
A<int> a;
A<int *> b;
}
----------------------
Note that the Comeau compiler rejects it with the following error message:
"ComeauTest.c", line 6: error: this declaration cannot have multiple "template
<...>" clauses
struct A<T*> {};
^
--
Summary: Accepts invalid code for partial specializations.
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sylvain dot pion at sophia dot inria dot fr
GCC host triplet: x86_64-redhat-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34834