This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/34834] New: Accepts invalid code for partial specializations.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]