This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51426] New: explicit instantiation declaration without definition
- From: "mkp76 at wp dot pl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 05 Dec 2011 18:41:14 +0000
- Subject: [Bug c++/51426] New: explicit instantiation declaration without definition
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51426
Bug #: 51426
Summary: explicit instantiation declaration without definition
Classification: Unclassified
Product: gcc
Version: 4.6.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: mkp76@wp.pl
The below code can be compiled (with -std=C++0x option).
--------------------------
template <typename T>
struct A { };
extern template
struct A<int>;
int main()
{
A<int> a;
}
--------------------------
According to C++11 standard (14.7 paragraph 5) it shouldn't
"an explicit instantiation definition shall appear at most once in a program"
I was trying to test 'extern templates' based on Bjarne Stroustrup's page:
http://www2.research.att.com/~bs/C++0xFAQ.html#extern-templates
Regards,
Marcin