This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/20980] internal compiler error on static member assignment
- From: "mendola at bigfoot dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Apr 2005 06:07:16 -0000
- Subject: [Bug c++/20980] internal compiler error on static member assignment
- References: <20050412225017.20980.mendola@bigfoot.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From mendola at bigfoot dot com 2005-04-13 06:07 -------
(In reply to comment #2)
> (In reply to comment #1)
> > The code is invalid:
> > t.cc: In instantiation of ?S& Test<S>::myS?:
> > t.cc:32: instantiated from ?static void Test<T>::out() [with T = S]?
> > t.cc:40: instantiated from here
> > t.cc:49: error: cannot call member function ?S& S::instance()? without object
> >
> >
> > This is fixed for 4.0.0.
>
> Declare that method as static, the code become valid but the compiler
> still crash.
>
>
> Regards
> Gaetano Mendola
Just a follow up, if you move that two template initialization:
template <class T> int Test<S>::myInt;
template <class T> S& Test<S>::myS = S::instance();
from main.cpp to c.cpp then
3.4.3 have a link problems
4.0.0 crash: c.cpp:5: internal compiler error: in import_export_decl, at
cp/decl2.c:1733
Regards
Gaetano Mendola
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20980