Bug 89199 - Internal compiler error when generating executable from source code involving IFSTREAMs.
Internal compiler error when generating executable from source code involving...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: gcc3 (Show other bugs)
9
athlon Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-04-20 10:07 EDT by Edgar Troudt
Modified: 2007-04-18 12:53 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-03 17:52:44 EDT
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 Edgar Troudt 2003-04-20 10:07:54 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225

Description of problem:
#include <iostream>
#include <fstream>

using namespace std;

int main () {
        int i = 0;
        switch ( i ) {
                case 0:
                        ifstream input;
                        break;
           
                case 1:
                          cout << "This is  case 1" << endl;

        }
} 

The above code when compiled on my RedHat 9 Linux system yields the following
error message:

ifs2.cpp: In function `int main()':
ifs2.cpp:13: jump to case label
ifs2.cpp:10:   crosses initialization of `std::ifstream input'

Internal compiler error: Error reporting routines re-entered.
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions. 


G++ on other systems rejects the code as well, but do not report internal
compiler error problems.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Copy the above source code to a CPP file.
2. Use G++ to compile the source file.

    

Actual Results:  Internal compiler error: Error reporting routines re-entered.
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions. 

Expected Results:  From a DEC UNIX machine:
(uname -a: OSF1 V4.0 1091 alpha)
(g++ --version: 2.95.3)

ifs2.cpp: In function `int main()':
ifs2.cpp:14: case label `1' within scope of cleanup or variable array
ifs2.cpp:10: warning: destructor needed for `class ifstream input'
ifs2.cpp:14: warning: where case label appears here
ifs2.cpp:14: warning: (enclose actions of previous case statements requiring
ifs2.cpp:14: warning: destructors in their own binding contours.)
ifs2.cpp:14: jump to case label
ifs2.cpp:10:   crosses initialization of `class ifstream input'


Additional info:
Comment 1 Richard Henderson 2004-10-03 17:52:44 EDT
Fails through gcc 3.2.3-20; fixed in gcc 3.3.2-1.

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