c++/9411: Template function lookup problem (new parser)
rguenth@tat.physik.uni-tuebingen.de
rguenth@tat.physik.uni-tuebingen.de
Wed Jan 22 23:33:00 GMT 2003
>Number: 9411
>Category: c++
>Synopsis: Template function lookup problem (new parser)
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Wed Jan 22 23:26:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Richard Guenther
>Release: g++ (GCC) 3.4 20030122 (experimental)
>Organization:
>Environment:
ix86-linux
>Description:
The testcase below fails with
~/ix86/gcc3.4/bin/g++ -c parser3.cpp -Wall
parser3.cpp: In function `void bar(const D&) [with D = int]':
parser3.cpp:14: instantiated from here
parser3.cpp:9: error: no matching function for call to `Evaluator::foo(const
int&)'
if not explicitly specifying the <D>, it works. Earlier
g++ are fine, so is intel icpc in -ansi mode.
struct Evaluator {
template <class B>
void foo(const B&);
};
template <class D>
void bar(const D& d)
{
Evaluator().foo<D>(d);
}
void foobar()
{
bar(1);
}
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-bugs
mailing list