[Bug c++/30857] [4.1/4.2/4.3 regression] accepts both explicit instantiation and explicit specialization, duplicate explicit instantiations, etc.

simartin at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sun Sep 23 19:50:00 GMT 2007



------- 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



More information about the Gcc-bugs mailing list