This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/50595] New: template overload resolution insufficiently sensitive to name dependency?
- From: "zackw at panix dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 03 Oct 2011 04:14:13 +0000
- Subject: [Bug c++/50595] New: template overload resolution insufficiently sensitive to name dependency?
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50595
Bug #: 50595
Summary: template overload resolution insufficiently sensitive
to name dependency?
Classification: Unclassified
Product: gcc
Version: 4.6.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: zackw@panix.com
Created attachment 25401
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25401
test case
Per http://stackoverflow.com/questions/7630806 the expected output of the
attached test case should be
f(char): 1
f(int): T(1)
f(int): t
f(char): 1
f(char): T(1)
f(char): t
since the second and third calls to f() in g() have arguments that are
template-dependent, so resolution of *those* function calls (but not the first
call) should be deferred until the point of instantiation (h()), at which time
both f(int) and f(char) are visible. What actually happens with g++ 4.6 is
f(char): 1
f(char): T(1)
f(char): t
f(char): 1
f(char): T(1)
f(char): t
I'm not 100% convinced by the argument above, but I am convinced enough to see
what y'all think.