From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32130 invoked by alias); 2 Feb 2010 20:44:58 -0000 Received: (qmail 32110 invoked by uid 48); 2 Feb 2010 20:44:44 -0000 Date: Tue, 02 Feb 2010 20:44:00 -0000 Message-ID: <20100202204444.32109.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/31816] If a function foo is defined before declaring a template class A, overloaded version of foo defined after the class declaration will not be available within class A. In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "gael dot guennebaud at gmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-02/txt/msg00140.txt.bz2 ------- Comment #5 from gael dot guennebaud at gmail dot com 2010-02-02 20:44 ------- I hit the same issue, and according to c++ standard, here we have a _dependent_ lookup, and so the qHash(int*) overloads should be found. Here is an example directly taken from the C++ standard (14.6, #9): #include void f(char) {std::cout << "char ";} template void g(T t) { f(1); // f(char) f(T(1)); // dependent f(t); // dependent } void f(int) {std::cout << "int ";} int main() { g(2); // will cause one call of f(char) followed // by two calls of f(int) g('a'); // will cause three calls of f(char) } according to the c++ standard, the output should be: char int int char char char but gcc (4.x) returns: char char char char char char so, bug or non-bug ? -- gael dot guennebaud at gmail dot com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |gael dot guennebaud at gmail | |dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31816