public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/9781: ICE in cp_parser_template_id
@ 2003-02-23 16:38 ehrhardt
  0 siblings, 0 replies; 2+ messages in thread
From: ehrhardt @ 2003-02-23 16:38 UTC (permalink / raw)
  To: bangerth, gcc-bugs, gcc-prs, nobody

Synopsis: ICE in cp_parser_template_id

State-Changed-From-To: open->analyzed
State-Changed-By: cae
State-Changed-When: Sun Feb 23 16:38:53 2003
State-Changed-Why:
    Confirmed with 3.2 and 3.4. Already analyzed by Wolfgang.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9781


^ permalink raw reply	[flat|nested] 2+ messages in thread

* c++/9781: ICE in cp_parser_template_id
@ 2003-02-20 20:26 bangerth
  0 siblings, 0 replies; 2+ messages in thread
From: bangerth @ 2003-02-20 20:26 UTC (permalink / raw)
  To: gcc-gnats


>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:


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-02-23 16:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-23 16:38 c++/9781: ICE in cp_parser_template_id ehrhardt
  -- strict thread matches above, loose matches on Subject: below --
2003-02-20 20:26 bangerth

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).