[Bug c++/17445] too few template-parameter-lists
--- Additional Comments From owen at titan dot com 2005-07-28 18:47 --- From Wolfgang Bangerth: You need to write: template std::mapchar*,char* MyTypeSample::m_map = std::mapchar*,char*(); My problem with this is that it requires that the static member support the copy constructor. In my case, the static member is something that cannot be copied, so I put an explicit copy constructor into the private section of my template class, which makes the above statement generate an error that the copy constructor is private. How do I instantiate this static member? It's default constructor does all the initialization I want, and I don't want that initialization done twice. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17445
[Bug c++/17445] too few template-parameter-lists
--- Additional Comments From bangerth at dealii dot org 2005-07-28 19:43 --- I believe you can't. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17445
[Bug c++/17445] too few template-parameter-lists
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-04-25 04:09 --- *** Bug 21200 has been marked as a duplicate of this bug. *** -- What|Removed |Added CC||iguchi at coral dot t dot u- ||tokyo dot ac dot jp http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17445
[Bug c++/17445] too few template-parameter-lists
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-04-25 04:11 --- *** Bug 11585 has been marked as a duplicate of this bug. *** -- What|Removed |Added CC||mueller at kde dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17445
[Bug c++/17445] too few template-parameter-lists
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-04-25 04:12 --- *** Bug 14891 has been marked as a duplicate of this bug. *** -- What|Removed |Added CC||gabriele dot greco at darts ||dot it http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17445
[Bug c++/17445] too few template-parameter-lists
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-04-25 04:12 --- *** Bug 11930 has been marked as a duplicate of this bug. *** -- What|Removed |Added CC||schnetter at uni-tuebingen ||dot de http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17445
[Bug c++/17445] too few template-parameter-lists
--- Additional Comments From bangerth at dealii dot org 2005-04-19 14:08 --- Why? This code as always wrong. It has nothing to do with gcc3.4.x. W. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17445
[Bug c++/17445] too few template-parameter-lists
--- Additional Comments From leslie dot barnes at amd dot com 2005-04-18 06:38 --- (In reply to comment #2) You want: template MyTypeSample list; char *MyTypeSample::name = Hello\n; The following code seg faults with g++ 3.4.3. If I remove the template , it won't compile. On g++ 3.3, without the template it is happy and prints goodbye. With the template it also seg faults. I'd like to know if this is a bug, or my inability to figure out the correct syntax. thanks #include cstdio #include map template class T class MyType { public: static std::mapchar*,char* m_map; }; class Sample { }; template class MyTypeSample; template std::mapchar*,char* MyTypeSample::m_map; int main(int argc, char **argv) { MyTypeSample::m_map[hello]=goodbye; printf(%s\n,MyTypeSample::m_map[hello]); } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17445
[Bug c++/17445] too few template-parameter-lists
--- Additional Comments From giovannibajo at libero dot it 2005-04-18 09:08 --- A segfault in GCC is always a bug, even if the code is wrong. Would you please open a new bugreport about it? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17445
[Bug c++/17445] too few template-parameter-lists
--- Additional Comments From leslie dot barnes at amd dot com 2005-04-18 13:37 --- (In reply to comment #4) A segfault in GCC is always a bug, even if the code is wrong. Would you please open a new bugreport about it? Sorry, I wasn't clear. The binary seg faults, not the compiler. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17445
[Bug c++/17445] too few template-parameter-lists
--- Additional Comments From bangerth at dealii dot org 2005-04-18 20:16 --- This code has at least two bugs: template class MyTypeSample; template std::mapchar*,char* MyTypeSample::m_map; First, the instantiation must come *after* the definition of the static member. Second, the definition you thought you have written is in fact only the declaration of an explicit specialization of that member. It needs an initializer. You need to write template std::mapchar*,char* MyTypeSample::m_map = std::mapchar*,char*(); W. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17445
[Bug c++/17445] too few template-parameter-lists
--- Additional Comments From leslie dot barnes at amd dot com 2005-04-19 00:02 --- (In reply to comment #6) This code has at least two bugs: template class MyTypeSample; template std::mapchar*,char* MyTypeSample::m_map; First, the instantiation must come *after* the definition of the static member. Second, the definition you thought you have written is in fact only the declaration of an explicit specialization of that member. It needs an initializer. You need to write template std::mapchar*,char* MyTypeSample::m_map = std::mapchar*,char*(); W. (In reply to comment #6) This code has at least two bugs: template class MyTypeSample; template std::mapchar*,char* MyTypeSample::m_map; First, the instantiation must come *after* the definition of the static member. Second, the definition you thought you have written is in fact only the declaration of an explicit specialization of that member. It needs an initializer. You need to write template std::mapchar*,char* MyTypeSample::m_map = std::mapchar*,char*(); W. Great, thanks! If someone could put this on the g++ 3.4.3 changes page, that would probably save people quite a bit of time. http://www.gnu.org/software/gcc/gcc-3.4/changes.html -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17445