Bug 45828 - Segmentation fault when type-casting templates
Summary: Segmentation fault when type-casting templates
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 7.1
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-06-25 16:19 UTC by Need Real Name
Modified: 2007-03-27 03:46 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-12-15 15:14:39 UTC
Embargoed:


Attachments (Terms of Use)

Description Need Real Name 2001-06-25 16:19:49 UTC
Description of Problem:

When I compile a sample program below
---- cut here ----
template <class T> class A {
  T *d;
  public: void f() { (T[10])d; }
};
---- cut here ----
the compiler fails by throwing Segmentation fault. 
The code itself does nothing, but as far as I know, 
it seems semantically ok. 
I can typecast pointer to an array, can I?


How Reproducible:
Everytime


Steps to Reproduce:
1. compile the code.

Actual Results:
bugtest.cpp: In method `void A<T>::f ()':
bugtest.cpp:3: Internal error: Segmentation fault.

Expected Results:
Clean compilation or atleast more descriptive error message.


Additional Information:
Code compiles fine with IBM C++ for OS/2.

Comment 1 Jakub Jelinek 2001-08-09 14:21:04 UTC
Seems to be fixed with http://gcc.gnu.org/ml/gcc-patches/2001-01/msg00941.html
which will appear in gcc-2.96-96.


Note You need to log in before you can comment on or make changes to this bug.