public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/12222] New: explicit initialization of static template members seems ignored
@ 2003-09-09 10:16 stefaandr at hotmail dot com
  2003-09-09 14:08 ` [Bug c++/12222] " bangerth at dealii dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: stefaandr at hotmail dot com @ 2003-09-09 10:16 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: explicit initialization of static template members seems
                    ignored
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: stefaandr at hotmail dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu

Shouldn't this code output 1234?  It outputs 0 for me.  I used to write
b a<float>::b1 instead of template <> b a<float>::b1, but
I tried this after seeing comment 3 on bug 11930.  I can even
change the constructor of b into a non-default one and it still compiles...

using g++-3.4 (GCC) 3.4 20030907 (experimental)

#include <iostream>
struct b {
  b() { m = 1234; }; int m;
};
template <class T>
  struct a { static b b1; };
template struct a<float>;
template <> b a<float>::b1;
int main() {
  std::cout << a<float>::b1.m << std::endl;
};


^ permalink raw reply	[flat|nested] 7+ messages in thread
[parent not found: <bug-12222-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2012-02-01  3:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-09 10:16 [Bug c++/12222] New: explicit initialization of static template members seems ignored stefaandr at hotmail dot com
2003-09-09 14:08 ` [Bug c++/12222] " bangerth at dealii dot org
2003-09-09 17:53 ` stefaandr at hotmail dot com
2003-09-09 18:57 ` bangerth at dealii dot org
2003-12-26 23:36 ` pinskia at gcc dot gnu dot org
2004-08-16 18:37 ` bangerth at dealii dot org
     [not found] <bug-12222-4@http.gcc.gnu.org/bugzilla/>
2012-02-01  3:07 ` pinskia at gcc dot gnu.org

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