public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/6078: Template params in functions not picking up types correctly from arguments
@ 2002-07-28  3:51 lerdsuwa
  0 siblings, 0 replies; 3+ messages in thread
From: lerdsuwa @ 2002-07-28  3:51 UTC (permalink / raw)
  To: f_ker, gcc-bugs, gcc-prs, nobody

Synopsis: Template params in functions not picking up types correctly from arguments

State-Changed-From-To: analyzed->closed
State-Changed-By: lerdsuwa
State-Changed-When: Sun Jul 28 03:51:08 2002
State-Changed-Why:
    Not a bug.  The displayed candidate cannot be used.
    You are initializing the type 'volatile int*&'
    with an lvalue returning from the function call ret_func()
    which is not allowed.  An lvalue can only initialize a 
    reference of non-volatile constant type (via a temporary 
    variable).  See Section 8.5.3 p4 in the standard for more
    details.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6078


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

* Re: c++/6078: Template params in functions not picking up types correctly from arguments
@ 2002-07-23  8:16 lerdsuwa
  0 siblings, 0 replies; 3+ messages in thread
From: lerdsuwa @ 2002-07-23  8:16 UTC (permalink / raw)
  To: f_ker, gcc-bugs, gcc-prs, nobody

Synopsis: Template params in functions not picking up types correctly from arguments

State-Changed-From-To: open->analyzed
State-Changed-By: lerdsuwa
State-Changed-When: Tue Jul 23 08:16:17 2002
State-Changed-Why:
    Confirmed.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6078


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

* c++/6078: Template params in functions not picking up types correctly from arguments
@ 2002-03-27 19:56 f_ker
  0 siblings, 0 replies; 3+ messages in thread
From: f_ker @ 2002-03-27 19:56 UTC (permalink / raw)
  To: gcc-gnats


>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:


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

end of thread, other threads:[~2002-07-28 10:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-28  3:51 c++/6078: Template params in functions not picking up types correctly from arguments lerdsuwa
  -- strict thread matches above, loose matches on Subject: below --
2002-07-23  8:16 lerdsuwa
2002-03-27 19:56 f_ker

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