public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: f_ker@yahoo.co.uk
To: gcc-gnats@gcc.gnu.org
Subject: c++/6078: Template params in functions not picking up types correctly from arguments
Date: Wed, 27 Mar 2002 19:56:00 -0000	[thread overview]
Message-ID: <20020328035056.30482.qmail@sources.redhat.com> (raw)


>Number:         6078
>Category:       c++
>Synopsis:       Template params in functions not picking up types correctly from arguments
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 27 19:56:09 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     f_ker@yahoo.co.uk
>Release:        gcc 3.0.4
>Organization:
>Environment:
i686-pc-linux-gnu
>Description:
A function with templatised arguments, when called, should automatically resolve the template arguments from the arguments of the function call.  In this special case, it doesn't.

>How-To-Repeat:
volatile int*
ret_func()
{return (volatile int*)0xdeadbeef;}
template<unsigned i>
struct D
{
	template<typename T1, typename T2>
	void
	a_func(T1& t1, const T2& t2)
	{
		t1[i] = t2[i];
	}
};
int data[16];
int
main()
{
	D<0>::a_func(ret_func(), data);
}

This gives an error message that gives a candidate identical to the called function!

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2002-03-28  3:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-27 19:56 f_ker [this message]
2002-07-23  8:16 lerdsuwa
2002-07-28  3:51 lerdsuwa

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=20020328035056.30482.qmail@sources.redhat.com \
    --to=f_ker@yahoo.co.uk \
    --cc=gcc-gnats@gcc.gnu.org \
    /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).