From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13114 invoked by alias); 6 Nov 2008 10:25:38 -0000 Received: (qmail 3759 invoked by uid 48); 6 Nov 2008 10:24:12 -0000 Date: Thu, 06 Nov 2008 10:25:00 -0000 Subject: [Bug c++/38030] New: g++ template with overloaded function behave differently on "g++ 4.3.2" and "g++ 3.4.6" X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "ashutosh dot nema at nechclst dot in" 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: 2008-11/txt/msg00463.txt.bz2 Dear All, I am unable to understand following test case behaviour. When i compile and execute this with g++ 3.4.6 it works fine. But when i compile and execute this with g++ 4.3.2 it aborts. I think the test case is OK. But g++ 4.3.2 having bug. Below is test case: ========================================================== #define ieq(X,Y) if((X)!=(Y)) abort(); extern void abort (); struct B_ { int i; }; struct D_:public B_ { }; D_ d_; int f_ (B_ &) { return 100; } template < class T > int g_ (T t) { return f_ (d_) + f_ (t); } int f_ (D_ &) { return 1; } int main (int argc, char *argv[]) { D_ d; ieq (g_ (d), 101); return 0; } ========================================================== Please help me regarding this. -- Summary: g++ template with overloaded function behave differently on "g++ 4.3.2" and "g++ 3.4.6" Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ashutosh dot nema at nechclst dot in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38030