c++/2368: Internal error #92 (catch clauses)

schmid@snake.iap.physik.tu-darmstadt.de schmid@snake.iap.physik.tu-darmstadt.de
Fri Mar 23 13:36:00 GMT 2001


>Number:         2368
>Category:       c++
>Synopsis:       Internal error #92 (catch clauses)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 23 13:36:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Peter Schmid
>Release:        3.0 20010321 (prerelease)
>Organization:
TU Darmstadt
>Environment:
System: Linux kiste 2.4.2 #34 Sun Feb 25 20:03:34 CET 2001 i686 unknown
Architecture: i686
SuSE 7.1
Glibc 2.2
GNU ld version 2.11.90.0.1 (with BFD 2.11.90.0.1)
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc/configure --enable-shared --disable-nls --enable-threads=posix --enable-long-long --enable-languages=c,c++,f77,objc
>Description:
The compilation of the source code te.C causes an internal compiler
error #92 in get_base_distance, at cp/search.c:453. This code is
extracted from the file exceptions.cpp part of the lambda library version
0.000526. Gcc 2.95 has no problem compiling the code. When one of the
catch clauses is removed, the code compiles without a warning.  

>How-To-Repeat:
Source code te.C
struct nil {};

template <int I, class Act> class action;

template <class Act, class Args> class lambda_functor_base;

template <class Catch1, 
          class Catch2 = nil, class Catch3 = nil, class Catch4 = nil,
          class Catch5 = nil, class Catch6 = nil, class Catch7 = nil, 
	  class Catch8 = nil, class Catch9 = nil, class Catch10 = nil>
struct catch_list_action {};

template<class CatchActions>
struct try_catch_action {};

template<class Args, class CatchType1, class CatchType2>
class lambda_functor_base<action<3, try_catch_action<catch_list_action<CatchType1, CatchType2> > >, Args> {
  Args args;
public:
  explicit lambda_functor_base(const Args& a) : args(a) {}

  template<class RET, class A, class B, class C>
  RET call(A& a, B& b, C& c) const {
	try 
        {

	}
        catch (CatchType1& e)
	{ 

	}
        catch (CatchType2& e)
	{      	

	}
  }
};


int main()
{
}

Compiling te.C
g++ -v -o te te.C -W -Wall -save-temps
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/specs
Configured with: ../gcc/configure --enable-shared --disable-nls --enable-threads=posix --enable-long-long --enable-languages=c,c++,f77,objc
gcc version 3.0 20010321 (prerelease)
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/cpp0 -lang-c++ -D_GNU_SOURCE -D__GNUG__=3 -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -v -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__STDC_HOSTED__=1 -W -Wall -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ te.C te.ii
GNU CPP version 3.0 20010321 (prerelease) (cpplib) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include/g++-v3
 /usr/local/include/g++-v3/i686-pc-linux-gnu
 /usr/local/include
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/include
 /usr/local/i686-pc-linux-gnu/include
 /usr/include
End of search list.
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/cc1plus -fpreprocessed te.ii -quiet -dumpbase te.C -W -Wall -version -o te.s
GNU CPP version 3.0 20010321 (prerelease) (cpplib) (i386 Linux/ELF)
GNU C++ version 3.0 20010321 (prerelease) (i686-pc-linux-gnu)
	compiled by GNU C version 3.0 20010321 (prerelease).
te.C: In member function `RET lambda_functor_base<action<3, 
   try_catch_action<catch_list_action<CatchType1, CatchType2, nil, nil, nil, 
   nil, nil, nil, nil, nil> > >, Args>::call(A&, B&, C&) const':
te.C:36: Internal error #92.
te.C:36: Internal compiler error in get_base_distance, at cp/search.c:453
Please submit a full bug report, with preprocessed source if appropriate.
See <URL: http://www.gnu.org/software/gcc/bugs.html > for instructions.

Preprocessed source code te.ii

# 1 "te.C"
struct nil {};

template <int I, class Act> class action;

template <class Act, class Args> class lambda_functor_base;

template <class Catch1,
          class Catch2 = nil, class Catch3 = nil, class Catch4 = nil,
          class Catch5 = nil, class Catch6 = nil, class Catch7 = nil,
          class Catch8 = nil, class Catch9 = nil, class Catch10 = nil>
struct catch_list_action {};

template<class CatchActions>
struct try_catch_action {};

template<class Args, class CatchType1, class CatchType2>
class lambda_functor_base<action<3, try_catch_action<catch_list_action<CatchType1, CatchType2> > >, Args> {
  Args args;
public:
  explicit lambda_functor_base(const Args& a) : args(a) {}

  template<class RET, class A, class B, class C>
  RET call(A& a, B& b, C& c) const {
        try
        {

        }
        catch (CatchType1& e)
        {

        }
        catch (CatchType2& e)
        {

        }
  }
};


int main()
{
}

>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list