public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51426] New: explicit instantiation declaration without definition
@ 2011-12-05 18:41 mkp76 at wp dot pl
  2011-12-05 18:55 ` [Bug c++/51426] " redi at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: mkp76 at wp dot pl @ 2011-12-05 18:41 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-12-06 17:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-05 18:41 [Bug c++/51426] New: explicit instantiation declaration without definition mkp76 at wp dot pl
2011-12-05 18:55 ` [Bug c++/51426] " redi at gcc dot gnu.org
2011-12-05 23:46 ` paolo.carlini at oracle dot com
2011-12-06  0:33 ` redi at gcc dot gnu.org
2011-12-06 17:49 ` mkp76 at wp dot pl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).