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]

internal compiler error


Hi,

I have mailed this bug report to bug-g++@prep.ai.mit.edu, since I encountered
it on g++ 2.8.1, but got no reply. A colleague who uses egcs 1.0.3 tells me
that he gets the same compiler error, so I post this report to you as well
in the hope you will prove more responsive ...

The following file

************* begin file gbug.cc *****************

template<class T>class A {
public:
    A(){}
    void mthd();
};

template<class T>
void A<T>::mthd()
{
    struct {
	double d;
    } t;
}

void main() {
    A<double> a;
}

************ end file gbug.cc **************

produces these compiler messages:

g++ gbug.cc -o gbug.o
gbug.cc: In method `void A<T>::mthd()':
gbug.cc:10: Internal compiler error.
gbug.cc:10: Please submit a full bug report to `egcs-bugs@cygnus.com'.
 
It appears that the compiler can't handle a struct inside a template
class method! (This strikes me as rather fundamental)

Do you have a solution to this problem? Any response, in particular a
patch, if one is already available for this, would be greatly appreciated.

Thanks

Martin Schweiger

----------------------------------------------------------------------------
Martin Schweiger, Ph.D.                University College London (UCL)
                                       Department of Medical Physics
Tel. +44-(0)171-2096262 (switchboard)  1st floor Shropshire House
Tel. +44-(0)171-2096411 (direct line)  11-20 Capper st.
Fax: +44-(0)171-2096269                London WC1E 6JA
Email: martins@medphys.ucl.ac.uk       United Kingdom
URL: http://www.medphys.ucl.ac.uk/~martins/
----------------------------------------------------------------------------



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