From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7729 invoked by alias); 11 Apr 2003 19:46: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 7709 invoked by uid 71); 11 Apr 2003 19:46:00 -0000 Resent-Date: 11 Apr 2003 19:46:00 -0000 Resent-Message-ID: <20030411194600.7708.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, mark@codesourcery.com Resent-Reply-To: gcc-gnats@gcc.gnu.org, bangerth@dealii.org Received: (qmail 4901 invoked by uid 48); 11 Apr 2003 19:40:54 -0000 Message-Id: <20030411194054.4900.qmail@sources.redhat.com> Date: Fri, 11 Apr 2003 19:46:00 -0000 From: bangerth@dealii.org Reply-To: bangerth@dealii.org To: gcc-gnats@gcc.gnu.org Cc: mark@codesourcery.com X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) X-GNATS-Notify: mark@codesourcery.com Subject: c++/10381: [3.4 regression] Accepts call to inexistent function X-SW-Source: 2003-04/txt/msg00516.txt.bz2 List-Id: >Number: 10381 >Category: c++ >Synopsis: [3.4 regression] Accepts call to inexistent function >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: accepts-illegal >Submitter-Id: net >Arrival-Date: Fri Apr 11 19:46:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Wolfgang Bangerth >Release: unknown-1.0 >Organization: >Environment: mainline (3.4) >Description: This is actually almost unbelievable: present 3.4 accepts this code: ----------------------------- struct X {}; template struct Base { static void foo () { X::NONEXISTENT (); } }; int main () { Base<2>::foo (); } ----------------------------- Note the call to the nonexistent member function of X. What is worse: it doesn't even generate a linker error, it just ignores the call in the front end. I stumbled upon this because I mistyped the name of a function, and was wondering why the call to it had no effect -- very, very deceiving. The program can be linked and run, by the way, but doesn't do anything useful. Mark, I CC: you because this might be cause by the two-stage name lookup, but I'm in no way sure whether that's the case. I would really love to see this being fixed quickly, since it's so mean and can take you a long time to find... W. >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: