public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Pollard <andrew@odie.demon.co.uk>
To: mmitchell@usa.net
Cc: egcs@cygnus.com
Subject: Re: PATCH for Re: egcs-1.0.2, egcs-980315 and templates
Date: Mon, 23 Mar 1998 15:35:00 -0000	[thread overview]
Message-ID: <199803231607.QAA22179@odie.demon.co.uk> (raw)
In-Reply-To: <smtp.earthlink.net>

Mark Mitchell <mmitchell@usa.net> wrote:

>Andrew --
>
>  Here's a patch for your problem.  Jason?
>

Just to let you know that this worked fine for me (under egcs-980321).

>From what I could understand from the draft C++ spec, I can't see why
>>the call to foo(k) in A::bar should instantiate the template and hence
>>make the specialization invalid.

Glad to see that I did understand the C++ spec correctly :-)

Cheers,
 Andrew.

>
>Sat Mar 21 19:00:03 1998  Mark Mitchell  <mmitchell@usa.net>
>
>	* pt.c (tsubst): Clear TREE_USED for new FUNCTION_DECLs.
>
>Index: pt.c
>===================================================================
>RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/pt.c,v
>retrieving revision 1.101
>diff -c -p -r1.101 pt.c
>*** pt.c	1998/03/20 10:44:05	1.101
>--- pt.c	1998/03/22 02:57:30
>*************** tsubst (t, args, in_decl)
>*** 4063,4068 ****
>--- 4197,4203 ----
>  	TREE_CHAIN (r) = NULL_TREE;
>  	DECL_CHAIN (r) = NULL_TREE;
>  	DECL_PENDING_INLINE_INFO (r) = 0;
>+ 	TREE_USED (r) = 0;
>  
>  	if (IDENTIFIER_OPNAME_P (DECL_NAME (r)))
>  	  grok_op_properties (r, DECL_VIRTUAL_P (r), DECL_FRIEND_P (r));
>Index: spec16.C
>===================================================================
>RCS file: spec16.C
>diff -N spec16.C
>*** /dev/null	Mon Dec 31 20:00:00 1979
>--- spec16.C	Sat Mar 21 19:00:01 1998
>***************
>*** 0 ****
>--- 1,21 ----
>+ // Build don't link:
>+ 
>+ template<class K>
>+ struct A {
>+ 	int foo(const K&);
>+ 	int bar(const K&);
>+ };
>+ 
>+ template<class K>
>+ int
>+ A<K>::bar(const K& k)
>+ {
>+ 	return(foo(k));
>+ }
>+ 
>+ template<>
>+ int
>+ A<const char*>::foo(const char*const& k)
>+ {
>+         return((int)k);
>+ }


  parent reply	other threads:[~1998-03-23 15:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-03-13 18:47 An x86 patch for egcs Mark Mitchell
     [not found] ` <smtp.earthlink.net>
1998-03-13 18:29   ` H.J. Lu
1998-03-18 16:14   ` PATCH: add semantics.c Mark Mitchell
1998-03-19 21:47   ` PATCH for Re: cp/semantics.c is broken Mark Mitchell
1998-03-23 15:35   ` Andrew Pollard [this message]
1998-03-23 19:24   ` PATCH for Re: egcs-1.0.2, egcs-980315 and templates Mark Mitchell
  -- strict thread matches above, loose matches on Subject: below --
1998-03-19 12:55 Andrew Pollard
1998-03-19 12:55 cp/semantics.c is broken H.J. Lu
1998-03-12 17:24 An x86 patch for egcs H.J. Lu
1998-03-16 19:46 ` Jim Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199803231607.QAA22179@odie.demon.co.uk \
    --to=andrew@odie.demon.co.uk \
    --cc=egcs@cygnus.com \
    --cc=mmitchell@usa.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).