public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/15006] New: error: too few template-parameter-lists
@ 2004-04-18 21:14 pluto at ds14 dot agh dot edu dot pl
  2004-04-18 21:16 ` [Bug c++/15006] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 3+ messages in thread
From: pluto at ds14 dot agh dot edu dot pl @ 2004-04-18 21:14 UTC (permalink / raw)
  To: gcc-bugs

testcase # http://149.156.124.14/~pluto/tmp/siod.ii 
 
# gcc -v  (fresh build) 
Reading specs from /usr/lib/gcc/pentium3-pld-linux/3.4.0/specs 
Configured with: ../configure --prefix=/usr --libdir=/usr/lib 
--libexecdir=/usr/lib --infodir=/usr/share/info --mandir=/usr/share/man 
--enable-shared --enable-threads=posix --enable-__cxa_atexit 
--enable-languages=c,c++,f77,objc,ada,java --enable-c99 --enable-long-long 
--enable-multilib --enable-nls --with-gnu-as --with-gnu-ld --with-system-zlib 
--with-slibdir=/lib --without-x pentium3-pld-linux 
Thread model: posix 
gcc version 3.4.0 20040416 (prerelease) (PLD Linux)

-- 
           Summary: error: too few template-parameter-lists
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pluto at ds14 dot agh dot edu dot pl
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: pentium3-pld-linux
  GCC host triplet: pentium3-pld-linux
GCC target triplet: pentium3-pld-linux


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


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

* [Bug c++/15006] error: too few template-parameter-lists
  2004-04-18 21:14 [Bug c++/15006] New: error: too few template-parameter-lists pluto at ds14 dot agh dot edu dot pl
@ 2004-04-18 21:16 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-18 21:16 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-18 21:10 -------
Reduced to:
template<class K, class V> class EST_THash;
class EST_String
{
};
class EST_Regex
{
};
template<class K, class V>
class EST_THash {
private:
  static V Dummy_Value;
  static K Dummy_Key;
};
EST_Regex * EST_THash< EST_String, EST_Regex * >::Dummy_Value;
EST_String EST_THash< EST_String, EST_Regex * >::Dummy_Key;

But this is invalid.  to explicit instantiation, do the follwoing:
template <> EST_Regex * EST_THash< EST_String, EST_Regex * >::Dummy_Value;
template <> EST_String EST_THash< EST_String, EST_Regex * >::Dummy_Key;
template  EST_Regex * EST_THash< EST_String, EST_Regex * >::Dummy_Value;
template EST_String EST_THash< EST_String, EST_Regex * >::Dummy_Key;

But just to define the space for the definition do:
template <> EST_Regex * EST_THash< EST_String, EST_Regex * >::Dummy_Value;
template <> EST_String EST_THash< EST_String, EST_Regex * >::Dummy_Key;

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


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


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

* [Bug c++/15006] error: too few template-parameter-lists
       [not found] <20040418205243.15006.pluto@agmk.net>
@ 2005-07-10 20:00 ` beorn_johnson at yahoo dot com
  0 siblings, 0 replies; 3+ messages in thread
From: beorn_johnson at yahoo dot com @ 2005-07-10 20:00 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From beorn_johnson at yahoo dot com  2005-07-10 19:55 -------
Addendum for those who continue to have difficulty:

I found that the order of the "template ..." vs. "template<> ..." made
a difference, but in linking, not in compiling.  From the previous example:
    template <> EST_Regex * EST_THash< EST_String, EST_Regex * >::Dummy_Value;
    template <> EST_String EST_THash< EST_String, EST_Regex * >::Dummy_Key;
    template  EST_Regex * EST_THash< EST_String, EST_Regex * >::Dummy_Value;
    template EST_String EST_THash< EST_String, EST_Regex * >::Dummy_Key;

The (equivalent of the) above would not generate symbols in my '.o', however:
    template  EST_Regex * EST_THash< EST_String, EST_Regex * >::Dummy_Value;
    template EST_String EST_THash< EST_String, EST_Regex * >::Dummy_Key;
    template <> EST_Regex * EST_THash< EST_String, EST_Regex * >::Dummy_Value;
    template <> EST_String EST_THash< EST_String, EST_Regex * >::Dummy_Key;
will work.   (Note: my case was slightly more complicated, in that instead of "EST_Regex" for the
final type, I had a templated type).  This was in 3.4.2.

Hope this helps.

-- 


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


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

end of thread, other threads:[~2005-07-10 19:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-18 21:14 [Bug c++/15006] New: error: too few template-parameter-lists pluto at ds14 dot agh dot edu dot pl
2004-04-18 21:16 ` [Bug c++/15006] " pinskia at gcc dot gnu dot org
     [not found] <20040418205243.15006.pluto@agmk.net>
2005-07-10 20:00 ` beorn_johnson 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).