public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/31378]  New: "too few template-parameter-lists" when initializing static template member
@ 2007-03-27 18:43 trumsko at yahoo dot com
  2007-03-27 19:03 ` [Bug c++/31378] " pinskia at gcc dot gnu dot org
  2007-03-27 19:56 ` trumsko at yahoo dot com
  0 siblings, 2 replies; 3+ messages in thread
From: trumsko at yahoo dot com @ 2007-03-27 18:43 UTC (permalink / raw)
  To: gcc-bugs

When compiling the following program the g++ 4.1.0 gives the error message:
"testtemplstatic.cpp:22: error: too few template-parameter-lists". Which I
interprete as a complaint, that a "template<>" is missing.
If I uncomment the "template<>" in line 21 g++ prints the error message:
"testtemplstatic.cpp:22: error: template header not allowed in member
definition of explicitly specialized class", which I interprete as having a
"template<>" too much.
One of the both versions (presumably the first) should be correct.

My configuration:
> g++ -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.1.0/configure
--prefix=/flc/flc03/data/samson/soft/gcc/4.1.0 --enable-languages=c,c++
Thread model: posix
gcc version 4.1.0

Regretfully I cannot check the bug with an 4.1.2 version of g++, as the
compilation of gcc 4.1.2 fails with an linker error on a Scientific Linux
(RHEL3) machine.

Cheers, T.




#include <iostream>

using namespace std;


template< class T >
struct foo
{
  struct bar;
};


template<>
struct foo<int>::bar
{
  const static char* blubb;
};

template struct foo<int>;

//template<>
const char* foo<int>::bar::blubb = "huhu";


int main()
{
  cout << foo<int>::bar::blubb <<endl;
}


-- 
           Summary: "too few template-parameter-lists" when initializing
                    static template member
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: trumsko at yahoo dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug c++/31378] "too few template-parameter-lists" when initializing static template member
  2007-03-27 18:43 [Bug c++/31378] New: "too few template-parameter-lists" when initializing static template member trumsko at yahoo dot com
@ 2007-03-27 19:03 ` pinskia at gcc dot gnu dot org
  2007-03-27 19:56 ` trumsko at yahoo dot com
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-03-27 19:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2007-03-27 20:03 -------
This has been fixed on the trunk for sure, I don't when it was fixed either. 
It fails in 4.1.1 also.


-- 


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


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

* [Bug c++/31378] "too few template-parameter-lists" when initializing static template member
  2007-03-27 18:43 [Bug c++/31378] New: "too few template-parameter-lists" when initializing static template member trumsko at yahoo dot com
  2007-03-27 19:03 ` [Bug c++/31378] " pinskia at gcc dot gnu dot org
@ 2007-03-27 19:56 ` trumsko at yahoo dot com
  1 sibling, 0 replies; 3+ messages in thread
From: trumsko at yahoo dot com @ 2007-03-27 19:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from trumsko at yahoo dot com  2007-03-27 20:56 -------
Finally I managed to compile the 4.1.2 version of gcc and the error does not
occur any more. 


-- 

trumsko at yahoo dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2007-03-27 19:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-27 18:43 [Bug c++/31378] New: "too few template-parameter-lists" when initializing static template member trumsko at yahoo dot com
2007-03-27 19:03 ` [Bug c++/31378] " pinskia at gcc dot gnu dot org
2007-03-27 19:56 ` trumsko at yahoo dot com

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