Bug 89199 - Internal compiler error when generating executable from source code involving IFSTREAMs.
Summary: Internal compiler error when generating executable from source code involving...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc3
Version: 9
Hardware: athlon
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-04-20 14:07 UTC by Edgar Troudt
Modified: 2007-04-18 16:53 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-10-03 21:52:44 UTC
Embargoed:


Attachments (Terms of Use)

Description Edgar Troudt 2003-04-20 14:07:54 UTC
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 21:52:44 UTC
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.