Bug 14242 - [3.4/4.0 regression] symbol lookup in templates
Summary: [3.4/4.0 regression] symbol lookup in templates
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.4.0
: P2 critical
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-22 14:50 UTC by Debian GCC Maintainers
Modified: 2005-07-23 22:49 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
testcase (132 bytes, text/x-c++src)
2004-02-22 14:50 UTC, Debian GCC Maintainers
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Debian GCC Maintainers 2004-02-22 14:50:18 UTC
[forwarded from http://bugs.debian.org/233934]

code compiles ok with 3.3.3, not with 3.4 CVS 20040221

g++-3.4 bug-233934.cc 
bug-233934.cc: In function `void foo() [with T = double]':
bug-233934.cc:14:   instantiated from here
bug-233934.cc:7: error: no matches converting function `bla' to type `void
(*)(const double&)'
bug-233934.cc:1: error: candidates are: void bla(const char&)
bug-233934.cc:2: error:                 void bla(const int&)
Comment 1 Debian GCC Maintainers 2004-02-22 14:50:49 UTC
Created attachment 5782 [details]
testcase
Comment 2 Andrew Pinski 2004-02-23 01:06:48 UTC
This is a dup of bug 13549, note the testcases are different but the problem is the same, also note the 
standard does not say which is right behaviour.

*** This bug has been marked as a duplicate of 13549 ***
Comment 3 Giovanni Bajo 2004-03-06 19:12:45 UTC
I don't think this is a duplicate of 13549. For once, Bug 13549 is about the 
lookup of template-ids, while here we have an unqualified id.
Comment 4 Giovanni Bajo 2004-03-06 19:17:44 UTC
Nathan, can you please comment on this testcase? I can't see how this can be 
valid since 'bla' is an unqualified non-dependent id which has to be looked up 
at template definition time. The lookup will found an overload set, and the 
disambiguation will have to be deferred till instantiation time as the 
assignment expression is type-dependent. 

But latest EDG and MSVC71 accepts the code.
Comment 5 Mark Mitchell 2004-03-09 07:02:53 UTC
This is not a bug.  

The name is non-dependent, and so name lookup finds only the first two declarations.