This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/6078: Template params in functions not picking up types correctly from arguments
- From: f_ker at yahoo dot co dot uk
- To: gcc-gnats at gcc dot gnu dot org
- Date: 28 Mar 2002 03:50:56 -0000
- Subject: c++/6078: Template params in functions not picking up types correctly from arguments
- Reply-to: f_ker at yahoo dot co dot uk
>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: