This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/9411: Template function lookup problem (new parser)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]