Bug 28742 - [4.2 regression] ICE with virtual destructor in invalid template class
Summary: [4.2 regression] ICE with virtual destructor in invalid template class
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.2.0
: P4 minor
Target Milestone: 4.2.0
Assignee: Not yet assigned to anyone
URL:
Keywords: error-recovery, ice-on-invalid-code, monitored
Depends on:
Blocks: 27668
  Show dependency treegraph
 
Reported: 2006-08-15 19:09 UTC by Volker Reichelt
Modified: 2006-08-30 03:41 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-08-20 15:15:59


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2006-08-15 19:09:27 UTC
The following invalid testcase triggers an ICE on mainline:

=========================================
template<void> struct A
{
  A();
  virtual ~A();
};

A<0> a;
=========================================

bug.cc:1: error: 'void' is not a valid type for a template constant parameter
bug.cc:3: error: templates may not be 'virtual'
bug.cc: In instantiation of 'A<<expression error> >':
bug.cc:7:   instantiated from here
bug.cc:3: internal compiler error: in finish_member_declaration, at cp/semantics.c:2243
Please submit a full bug report, [etc.]

If I remove the constructor or destructor, the ICE happens in the same
place as PR 24791.

This is probably fallout from PR 27668.
Comment 1 Richard Biener 2006-08-20 15:15:59 UTC
Confirmed.
Comment 2 Lee Millward 2006-08-29 19:11:13 UTC
This doesn't ICE for me on current mainline:

bug.cc:1: error: 'void' is not a valid type for a template constant parameter
bug.cc:3: error: templates may not be 'virtual'
bug.cc:7: error: '<type error>' is not a valid type for a template constant parameter
bug.cc:7: error: invalid type in declaration before ';' token

Can anyone confirm that the testcase still ICE's for them?
Comment 3 Andrew Pinski 2006-08-30 03:41:40 UTC
Fixed since at least "4.2.0 20060826".