This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/30857] [4.1/4.2/4.3 regression] accepts both explicit instantiation and explicit specialization, duplicate explicit instantiations, etc.
- From: "simartin at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Sep 2007 19:50:00 -0000
- Subject: [Bug c++/30857] [4.1/4.2/4.3 regression] accepts both explicit instantiation and explicit specialization, duplicate explicit instantiations, etc.
- References: <bug-30857-365@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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