Bug 45828 - Segmentation fault when type-casting templates
Segmentation fault when type-casting templates
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
7.1
All Linux
low Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-06-25 12:19 EDT by Need Real Name
Modified: 2007-03-26 23:46 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-12-15 10:14:39 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2001-06-25 12:19:49 EDT
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 10:21:04 EDT
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.