From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21123 invoked by alias); 20 Feb 2003 20:26: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 21104 invoked by uid 71); 20 Feb 2003 20:26:00 -0000 Resent-Date: 20 Feb 2003 20:26:00 -0000 Resent-Message-ID: <20030220202600.21103.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, bangerth@ticam.utexas.edu Received: (qmail 17649 invoked by uid 48); 20 Feb 2003 20:22:59 -0000 Message-Id: <20030220202257.17634.qmail@sources.redhat.com> Date: Thu, 20 Feb 2003 20:26:00 -0000 From: bangerth@ticam.utexas.edu Reply-To: bangerth@ticam.utexas.edu To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/9781: ICE in cp_parser_template_id X-SW-Source: 2003-02/txt/msg01033.txt.bz2 List-Id: >Number: 9781 >Category: c++ >Synopsis: ICE in cp_parser_template_id >Confidential: no >Severity: serious >Priority: low >Responsible: unassigned >State: open >Class: ice-on-illegal-code >Submitter-Id: net >Arrival-Date: Thu Feb 20 20:26:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Wolfgang Bangerth >Release: unknown-1.0 >Organization: >Environment: >Description: Found while tracking 9779: This illegal piece of code generates an ICE in all versions of gcc since at least 2.95: ---------------------------- template void foo(BOGUS) { sizeof (BOGUS); } template void foo(BOGUS); ----------------------------- g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c z.cc z.cc:1: error: variable or field `foo' declared void z.cc:1: error: template declaration of `int foo' z.cc:1: error: `BOGUS' has not been declared z.cc:1: error: expected expected `;' z.cc:4: internal compiler error: in cp_parser_template_id, at cp/parser.c:7996 Please submit a full bug report, Since the code is obviously bogus, and the ICE is after an error message, the priority is as low as could possibly be. Nevertheless, if someone wants to fix this: a backtrace is as this one: #0 cp_parser_template_id (parser=0x40192080, template_keyword_p=false, check_dependency_p=96) at ../../gcc-3.4-CVS/gcc/cp/parser.c:7996 #1 0x080f976e in cp_parser_class_name (parser=0x40192080, typename_keyword_p=false, template_keyword_p=false, type_p=false, check_access_p=true, check_dependency_p=true, class_head_p=false) at ../../gcc-3.4-CVS/gcc/cp/parser.c:11363 #2 0x080f1ceb in cp_parser_class_or_namespace_name (parser=0x40192080, typename_keyword_p=false, template_keyword_p=false, check_dependency_p=true, type_p=false) at ../../gcc-3.4-CVS/gcc/cp/parser.c:3489 #3 0x080f194f in cp_parser_nested_name_specifier_opt (parser=0x40192080, typename_keyword_p=false, check_dependency_p=true, type_p=false) at ../../gcc-3.4-CVS/gcc/cp/parser.c:3301 At the spot where it aborts is this: /* If it's not a class-template or a template-template, it should be a function-template. */ my_friendly_assert ((DECL_FUNCTION_TEMPLATE_P (template) || TREE_CODE (template) == OVERLOAD || BASELINK_P (template)), 20010716); W. >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: