public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: bangerth@ticam.utexas.edu
To: gcc-gnats@gcc.gnu.org
Subject: c++/9781: ICE in cp_parser_template_id
Date: Thu, 20 Feb 2003 20:26:00 -0000	[thread overview]
Message-ID: <20030220202257.17634.qmail@sources.redhat.com> (raw)


>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<bool> void foo(BOGUS) {
  sizeof (BOGUS);
}
template void foo<true>(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:


             reply	other threads:[~2003-02-20 20:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-20 20:26 bangerth [this message]
2003-02-23 16:38 ehrhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030220202257.17634.qmail@sources.redhat.com \
    --to=bangerth@ticam.utexas.edu \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).