public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* bug or feature?  partial specialization doesn't work in nestedcontext
@ 1999-05-22 11:31 Seapig6
  1999-05-22 11:44 ` bug or feature? partial specialization doesn't work innested context mark
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Seapig6 @ 1999-05-22 11:31 UTC (permalink / raw)
  To: egcs; +Cc: kosak

[if you reply by email, please use the kosak@cs.cmu.edu address]

I can't quite figure out if this is an egcs bug or a deliberate language 
feature (suggestions for better reference books than Stroustrup III 
gratefully accepted)

> cat partial.cc && g++ -v && g++ partial.cc
template<class T> struct cow {
  template <class U> struct moo;
  struct moo<char> { };
};
Reading specs from 
/afs/cs.cmu.edu/project/cmcl-kosak/various-gcc/egcs-19990517/i386_linux3/lib/g
cc-lib/i686-pc-linux-gnu/egcs-2.93.22/specs
gcc version egcs-2.93.22 19990517 (gcc2 ss-980929 experimental)
partial.cc:3: template parameters not used in partial specialization:
partial.cc:3:         `T'

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

* Re: bug or feature?  partial specialization doesn't work innested context
  1999-05-22 11:31 bug or feature? partial specialization doesn't work in nestedcontext Seapig6
@ 1999-05-22 11:44 ` mark
  1999-05-31 21:36   ` mark
  1999-05-24 11:07 ` bug or feature? partial specialization doesn't work in nestedcontext Gerald Pfeifer
  1999-05-31 21:36 ` Seapig6
  2 siblings, 1 reply; 6+ messages in thread
From: mark @ 1999-05-22 11:44 UTC (permalink / raw)
  To: Seapig6; +Cc: egcs, kosak

>>>>> "Seapig6" == Seapig6  <Seapig6@aol.com> writes:

    Seapig6> template<class T> struct cow { template <class U> struct
    Seapig6> moo; struct moo<char> { }; }; 

That's not a great error-message that you get, but your code is
illegal.  First, whenever you want an explicit specialization, the
standard requires you proceed it with `template <>'.  But, explicit
specializations are not allowed anywhere but in namespace scope; EGCS
will tell you this if you add the `template<>', and that's essentially
what's confusing it in your original case as well.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

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

* Re: bug or feature?  partial specialization doesn't work in nestedcontext
  1999-05-22 11:31 bug or feature? partial specialization doesn't work in nestedcontext Seapig6
  1999-05-22 11:44 ` bug or feature? partial specialization doesn't work innested context mark
@ 1999-05-24 11:07 ` Gerald Pfeifer
  1999-05-31 21:36   ` Gerald Pfeifer
  1999-05-31 21:36 ` Seapig6
  2 siblings, 1 reply; 6+ messages in thread
From: Gerald Pfeifer @ 1999-05-24 11:07 UTC (permalink / raw)
  To: Seapig6; +Cc: egcs, kosak

On Sat, 22 May 1999 Seapig6@aol.com wrote:
> I can't quite figure out if this is an egcs bug or a deliberate language 
> feature (suggestions for better reference books than Stroustrup III 
> gratefully accepted)

The ISO C++ standard, available as PDF at http://www.ansi.org/ (for a
small fee).

Gerald
-- 
Gerald "Jerry" pfeifer@dbai.tuwien.ac.at http://www.dbai.tuwien.ac.at/~pfeifer/

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

* Re: bug or feature?  partial specialization doesn't work in nestedcontext
  1999-05-24 11:07 ` bug or feature? partial specialization doesn't work in nestedcontext Gerald Pfeifer
@ 1999-05-31 21:36   ` Gerald Pfeifer
  0 siblings, 0 replies; 6+ messages in thread
From: Gerald Pfeifer @ 1999-05-31 21:36 UTC (permalink / raw)
  To: Seapig6; +Cc: egcs, kosak

On Sat, 22 May 1999 Seapig6@aol.com wrote:
> I can't quite figure out if this is an egcs bug or a deliberate language 
> feature (suggestions for better reference books than Stroustrup III 
> gratefully accepted)

The ISO C++ standard, available as PDF at http://www.ansi.org/ (for a
small fee).

Gerald
-- 
Gerald "Jerry" pfeifer@dbai.tuwien.ac.at http://www.dbai.tuwien.ac.at/~pfeifer/

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

* Re: bug or feature?  partial specialization doesn't work innested context
  1999-05-22 11:44 ` bug or feature? partial specialization doesn't work innested context mark
@ 1999-05-31 21:36   ` mark
  0 siblings, 0 replies; 6+ messages in thread
From: mark @ 1999-05-31 21:36 UTC (permalink / raw)
  To: Seapig6; +Cc: egcs, kosak

>>>>> "Seapig6" == Seapig6  <Seapig6@aol.com> writes:

    Seapig6> template<class T> struct cow { template <class U> struct
    Seapig6> moo; struct moo<char> { }; }; 

That's not a great error-message that you get, but your code is
illegal.  First, whenever you want an explicit specialization, the
standard requires you proceed it with `template <>'.  But, explicit
specializations are not allowed anywhere but in namespace scope; EGCS
will tell you this if you add the `template<>', and that's essentially
what's confusing it in your original case as well.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

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

* bug or feature?  partial specialization doesn't work in nestedcontext
  1999-05-22 11:31 bug or feature? partial specialization doesn't work in nestedcontext Seapig6
  1999-05-22 11:44 ` bug or feature? partial specialization doesn't work innested context mark
  1999-05-24 11:07 ` bug or feature? partial specialization doesn't work in nestedcontext Gerald Pfeifer
@ 1999-05-31 21:36 ` Seapig6
  2 siblings, 0 replies; 6+ messages in thread
From: Seapig6 @ 1999-05-31 21:36 UTC (permalink / raw)
  To: egcs; +Cc: kosak

[if you reply by email, please use the kosak@cs.cmu.edu address]

I can't quite figure out if this is an egcs bug or a deliberate language 
feature (suggestions for better reference books than Stroustrup III 
gratefully accepted)

> cat partial.cc && g++ -v && g++ partial.cc
template<class T> struct cow {
  template <class U> struct moo;
  struct moo<char> { };
};
Reading specs from 
/afs/cs.cmu.edu/project/cmcl-kosak/various-gcc/egcs-19990517/i386_linux3/lib/g
cc-lib/i686-pc-linux-gnu/egcs-2.93.22/specs
gcc version egcs-2.93.22 19990517 (gcc2 ss-980929 experimental)
partial.cc:3: template parameters not used in partial specialization:
partial.cc:3:         `T'

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

end of thread, other threads:[~1999-05-31 21:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-05-22 11:31 bug or feature? partial specialization doesn't work in nestedcontext Seapig6
1999-05-22 11:44 ` bug or feature? partial specialization doesn't work innested context mark
1999-05-31 21:36   ` mark
1999-05-24 11:07 ` bug or feature? partial specialization doesn't work in nestedcontext Gerald Pfeifer
1999-05-31 21:36   ` Gerald Pfeifer
1999-05-31 21:36 ` Seapig6

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