This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/29839] Template static member inherited from template class cannot be initialized
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Nov 2006 01:53:37 -0000
- Subject: [Bug c++/29839] Template static member inherited from template class cannot be initialized
- References: <bug-29839-13568@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from bangerth at dealii dot org 2006-11-15 01:53 -------
There's two problems here: first, you are missing a template<>
in front of your definition. Second, you can't initialize
static variables with
type class::variable();
since this is ambiguous to declaring a function of this name. You
need to write your definition as follows:
template <> A<C> B<C>::B_Aobj = A<C>();
W.
--
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bangerth at dealii dot org
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29839