From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25198 invoked by alias); 8 Dec 2002 23:06:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 25179 invoked by uid 71); 8 Dec 2002 23:06:01 -0000 Resent-Date: 8 Dec 2002 23:06:01 -0000 Resent-Message-ID: <20021208230601.25178.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, benoitsevigny@hotmail.com Received: (qmail 24730 invoked by uid 61); 8 Dec 2002 23:02:23 -0000 Message-Id: <20021208230223.24729.qmail@sources.redhat.com> Date: Sun, 08 Dec 2002 15:06:00 -0000 From: benoitsevigny@hotmail.com Reply-To: benoitsevigny@hotmail.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/8876: wrong template instantiation X-SW-Source: 2002-12/txt/msg00470.txt.bz2 List-Id: >Number: 8876 >Category: c++ >Synopsis: wrong template instantiation >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Sun Dec 08 15:06:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: Benoit Sevigny >Release: gcc version 3.2 (mingw special 20020817-1) >Organization: >Environment: Window XP >Description: When calling a static function of an explicitely instantiated template structure enclosed in another template structure, the wrong template is being instantiated. >How-To-Repeat: compile and run the attached code. It should print (as with Visual C++ 6.0): calling function<3> -> in function<3>: l = 1, r = 2 calling function<3> -> in function<3>: l = 2, r = 1 calling function<100> -> in function<100>: l = 1, r = 2 calling function<100> -> in function<100>: l = 2, r = 1 However, if it prints: calling function<3> -> in function<1>: l = 1, r = 2 calling function<3> -> in function<2>: l = 2, r = 1 calling function<100> -> in function<1>: l = 1, r = 2 calling function<100> -> in function<2>: l = 2, r = 1 Then the wrong function template it being instantiated. >Fix: No fix known >Release-Note: >Audit-Trail: >Unformatted: