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++/30857] [4.1/4.2/4.3 regression] accepts both explicit instantiation and explicit specialization, duplicate explicit instantiations, etc.



------- Comment #2 from simartin at gcc dot gnu dot org  2007-09-23 19:49 -------
I've done tests with the current mainline and I wonder if this PR is still
"valid"...

We report an error for the following three cases:

1. Multiple specializations:
   template <typename T> class A {};
   template<> class A<int> {};
   template<> class A<int> {};

2. Multiple explicit instantiations:
   template <typename T> class B {};
   template class B<int>;
   template class B<int>;

3. Specialization following an explicit instantiation:
   template <typename T> class D {};
   template class D<int>;
   template<> class D<int> {};

The fact that we accept an explicit instantiation after a specialization is due
to DR 259.


-- 

simartin at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simartin at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30857


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