This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/8513: g++ internal compiler error


>Number:         8513
>Category:       c++
>Synopsis:       g++ internal compiler error
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 09 20:26:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        3.1 or 3.2
>Organization:
Pixar Animation Studios
>Environment:
System: Linux zort 2.4.9-13psmp #1 SMP Tue Nov 13 15:24:04 EST 2001 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc-3.2/configure --prefix=/pixar/d2 --enable-languages=c,c++ --disable-nls --disable-shared
>Description:
	When running g++ 3.1 or 3.2 on the following input, I get an ICE:
	r.cpp: In static member function `static void (* A::GetFunc())()':
	r.cpp:15: Internal compiler error in c_expand_expr, at c-common.c:3646

>How-To-Repeat:
	Run "g++ -c" on the following code. (I simplified it as much as possible.)
----------------
typedef void (*FuncType)();

class A {
  public:
    template<class T> static void Func();
    static FuncType GetFunc();
};

template <class T>  class B {};

FuncType
A::GetFunc()
{
    return Func<int>;
}
----------------

>Fix:
	Work-around:
	Change the last line to "return A::Func<int>" and it works ok.
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]