From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22408 invoked by alias); 27 May 2004 07:15:27 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 22384 invoked by uid 48); 27 May 2004 07:15:25 -0000 Date: Thu, 27 May 2004 18:18:00 -0000 From: "igodard at pacbell dot net" To: gcc-bugs@gcc.gnu.org Message-ID: <20040527071518.15674.igodard@pacbell.net> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/15674] New: template argument binding differs between member and static fumctions X-Bugzilla-Reason: CC X-SW-Source: 2004-05/txt/msg03180.txt.bz2 List-Id: #include int a[5]; int* p; template class Foo { public: void S(T*) { std::cout << "found ref" << std::endl; } template void S(T(&a)[n]) { std::cout << "found array" << std::endl; } }; template void S(T*) { std::cout << "found ref" << std::endl; } template void S(T(&a)[n]) { std::cout << "found array" << std::endl; } int main() { Foo s; s.S(a); s.S(p); S(a); S(p); return 0; } When run, this produces: ~/ootbc/common/test/src$ a.out found ref found ref found array found ref That is, the two calls to the member S both bind to the T* template, but for the global functions with identical signature one binds to each overload. Ivan -- Summary: template argument binding differs between member and static fumctions Product: gcc Version: 3.4.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: igodard at pacbell dot net CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15674