CC crashes with signal 11

I have a problem with CC from SunStudio 11. It crashes while compiling with the following message

CC -I. -c Token.cpp

>> Signal 11:

while processing Token.cpp at line 5.

The OS is solaris 8 and I have installed patch 121017-10

Here is the source file

/* ANTLR Translator Generator

*/

#include "antlr/Token.hpp"

#include "antlr/String.hpp"

#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE

namespace antlr { // this is line 5

#endif

ANTLR_API RefToken Token::badToken = RefToken(new Token(Token::INVALID_TYPE, "<no text>"));

Token::Token() : type(INVALID_TYPE)

{

}

Token::Token(int t) : type(t)

{

}

Token::Token(int t, const ANTLR_USE_NAMESPACE(std)string& txt)

: type(t)

{

setText(txt);

}

void Token::setText(const ANTLR_USE_NAMESPACE(std)string&)

{}

void Token::setType(int t)

{

type = t;

}

Token::~Token()

{}

ANTLR_API RefToken nullToken;

#ifndef NO_STATIC_CONSTS

const int Token::MIN_USER_TYPE;

const int Token::NULL_TREE_LOOKAHEAD;

const int Token::INVALID_TYPE;

const int Token::EOF_TYPE;

const int Token::SKIP;

#endif

#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE

}

#endif

If I run a CC -E and a CC on the resulting file, the compiler crashes at the line

RefToken Token :: badToken = RefToken ( new Token ( Token :: INVALID_TYPE , "<no text>" ) ) ;

[1536 byte] By [ClemensBrogia] at [2007-11-27 4:19:31]
# 1
What ANTLR version do you try to compile? I will try to build the same version and figure out the reason of this bug.
Atanasyana at 2007-7-12 9:26:27 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2
> What ANTLR version do you try to compile? I will try> to build the same version and figure out the reason> of this bug.It is 2.7.4. It works on 2.7.7, but for our program we currently use 2.7.4
ClemensBrogia at 2007-7-12 9:26:27 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 3

Here is reduced test case for this problem. The latest development version of Sun C++ compiler does not have this bug.

[code]

struct string

{

string(const char *);

~string();

};

struct Token

{

Token(const string & txt);

};

template < class T >

struct RefCount

{

struct Ref

{

Ref ( T * p );

} * ref ;

RefCount ( T * p )

: ref ( p ? new Ref ( p ) : 0 )

{}

};

typedef RefCount<Token> RefToken ;

RefToken a = RefToken ( new Token ("") ) ;

[/code]

If you have a service contract you can escalate this bug. Contact support engineer for that. If you do not have service contract you may file a bug on http://java.sun.com/webapps/bugreport.

Atanasyana at 2007-7-12 9:26:27 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 4
Thanks for your help, I filed a bug report.
ClemensBrogia at 2007-7-12 9:26:28 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 5
The bug number is 6558244
clamage45a at 2007-7-12 9:26:28 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 6
Another question:in the bug database is written, that this bug will be fixed in Studio 12. Since I am running Solaris 8 on a ULTR-60 and Studio 12 is not supported on Solaris 8 I want to know if it is possible to get a fix for Sudio 11.
ClemensBrogia at 2007-7-12 9:26:28 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 7
If you have a support contract, you can escalate this bug through your support channel.Other than that, I think only critical bugs are backported to earlier versions of Sun Studio. However, I can't say whether this one is critical or not.
MaximKartasheva at 2007-7-12 9:26:28 > top of Java-index,Development Tools,Solaris and Linux Development Tools...