c++/10313: Compiler crashes on 'jump to case label' error

bugs@maircrosoft.com bugs@maircrosoft.com
Fri Apr 4 21:36:00 GMT 2003


>Number:         10313
>Category:       c++
>Synopsis:       Compiler crashes on 'jump to case label' error
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 04 21:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Mair Allen-Williams
>Release:        gcc 3.2.2
>Organization:
>Environment:
Debian 3.0
>Description:
Code error in switch statement (unclosed bracket resulting in default: label being inside another) later caused an internal compiler error. The error only occurred when a line above the error opened a filestream for input. 

The following code demonstrates the error:

//start code
#include <fstream>
using std::ifstream;

void cache_update(int act)
 {
    switch(act)
      {
      case 3:
	{
	  ifstream input(".listing");
	  int i=0;
	  while(++i<4)
	    {
	      bool found;
	      if (!found)
		{
		}
	      break;
	    }
	default:
	  {
	  }
	}
      }
    void createEmptyCache()
      {
      }
>How-To-Repeat:
save the code above into a file, say error.cpp

type gcc error.cpp

admire results
>Fix:
don't make coding errors
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-prs mailing list