public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/27572]  New: [4.0/4.1/4.2 regression] ICE on typedef in parameter declaration
@ 2006-05-12  9:44 reichelt at gcc dot gnu dot org
  2006-05-12  9:47 ` [Bug c++/27572] " reichelt at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-05-12  9:44 UTC (permalink / raw)
  To: gcc-bugs

The C++ frontend currently chokes on invalid typedefs in parameter
declarations for both functions and templates.
One can generate ICEs in many different places like the following
examples show:

======================================
void foo(typedef) {}
======================================

bug.cc:1: error: ISO C++ forbids declaration of 'parameter' with no type
bug.cc:1: error: typedef declaration invalid in parameter declaration
bug.cc: In function 'void foo(int)':
bug.cc:1: internal compiler error: tree check: expected tree that contains
'decl with RTL' structure, have 'type_decl'  in set_decl_rtl, at emit-rtl.c:949
Please submit a full bug report, [etc.]

======================================
void foo(typedef x[]) {}
======================================

ICE in pop_binding, at cp/name-lookup.c:380

======================================
template<typedef> void foo();

void bar()
{
  foo<int>();
}
======================================

ICE in instantiate_decl, at cp/pt.c:11703

======================================
template<typedef,int> struct A;
======================================

tree check ICE: expected template_type_parm or template_template_parm or
bound_template_template_parm, have integer_type in process_template_parm, at
cp/pt.c:2336

======================================
template<typedef> struct A
{
  void foo();
  void bar();
};

A<int> a;
======================================

ICE in finish_member_declaration, at cp/semantics.c:2212

======================================
template<typedef> struct A
{
  friend void foo();
};

A<int> a;
======================================

ICE in tsubst_decl, at cp/pt.c:6263

Some of these examples crash since GCC 2.95.3, but some (like the first
and last) since 3.4.0, so this is a regression.

Patch to follow.


-- 
           Summary: [4.0/4.1/4.2 regression] ICE on typedef in parameter
                    declaration
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, error-recovery, monitored
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27572


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

end of thread, other threads:[~2006-07-25  1:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-12  9:44 [Bug c++/27572] New: [4.0/4.1/4.2 regression] ICE on typedef in parameter declaration reichelt at gcc dot gnu dot org
2006-05-12  9:47 ` [Bug c++/27572] " reichelt at gcc dot gnu dot org
2006-05-12  9:48 ` patchapp at dberlin dot org
2006-05-12 19:36 ` pinskia at gcc dot gnu dot org
2006-06-04 19:02 ` mmitchel at gcc dot gnu dot org
2006-07-17  3:24 ` mmitchel at gcc dot gnu dot org
2006-07-24 14:15 ` patchapp at dberlin dot org
2006-07-25  0:57 ` reichelt at gcc dot gnu dot org
2006-07-25  1:02 ` reichelt at gcc dot gnu dot org
2006-07-25  1:06 ` reichelt at gcc dot gnu dot org
2006-07-25  1:55 ` reichelt at gcc dot gnu dot org

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