public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* RE: c++/4974: Problem to compile nested heritage of templated cla sses
@ 2001-12-03 21:26 Freissmann Lothar
0 siblings, 0 replies; only message in thread
From: Freissmann Lothar @ 2001-12-03 21:26 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/4974; it has been noted by GNATS.
From: Freissmann Lothar <freissmannl@thmulti.com>
To: "'Alexandre Oliva'" <aoliva@redhat.com>
Cc:
Subject: RE: c++/4974: Problem to compile nested heritage of templated cla
sses
Date: Mon, 3 Dec 2001 10:05:10 +0100
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_000_01C17BD9.9C8FE440
Content-Type: text/plain
Sorry, but it seems, that the automatic tool used did not work.
Here are the the source code and the ~.ii file greated with g++, version
2.95.3 20010315 under
System OS: Solaris 2.7, creating the following message:
g++ -save-temps bug.cpp
bug.cpp:51: Internal compiler error.
bug.cpp:51: Please submit a full bug report.
bug.cpp:51: See <URL:http://www.gnu.org/software/gcc/bugs.html> for
instructions.
Following the compiler directives I send you a file minimized to essentials
showing a compiler crash:
The file contains:
1. A templated class
2. a class with a templated subclass which is heriting the templated class.
Bug condition:
If the constructor of the subclass is only declared (Non_BUG = 1) the
compiler does not cry; but the compiler fails if the constructor is defined
in the subclass (Non_BUGGY = 0).
-----Original Message-----
From: Alexandre Oliva [mailto:aoliva@redhat.com]
Sent: Sunday, December 02, 2001 10:06 AM
To: freissmannl@thmulti.com
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/4974: Problem to compile nested heritage of templated
classes
It appears that your attachment didn't make it to the bug report.
Please post a followup to this message containing the attachment.
Make sure gcc-gnats@gcc.gnu.org gets a copy, and that the subject
remains unchanged. Thanks,
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me
------_=_NextPart_000_01C17BD9.9C8FE440
Content-Type: application/octet-stream;
name="bug.cpp"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="bug.cpp"
=0A=
=0A=
#include <stdio.h>=0A=
=0A=
#define Non_BUGGY 0=0A=
// =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Templated class =
heritage:=0A=
=0A=
=0A=
template <int LL>=0A=
class vector=0A=
{=0A=
protected:=0A=
int *arr;=0A=
int lgth;=0A=
=0A=
public:=0A=
vector() { arr =3D new int(LL);lgth =3D LL;};=0A=
vector(int ll) { arr =3D new int(ll); lgth =3D ll;};=0A=
void=0A=
put(int in,int ind) { if(0 <=3D ind && ind < lgth) arr[ind] =3D in;=0A=
else fprintf(stderr,"ind %d out of bounds [0 %d)!\n",ind,lgth);=0A=
};=0A=
int=0A=
get(int ind) { if(0 <=3D ind && ind < lgth) return arr[ind];=0A=
else {fprintf(stderr,"ind %d out of bounds [0 %d)!\n",ind,lgth);=0A=
return(-9);=0A=
};=0A=
};=0A=
};=0A=
=0A=
=0A=
// =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
Using it as subclass:=0A=
=0A=
=0A=
class top_class=0A=
{=0A=
// defining subclasses:=0A=
public:=0A=
=0A=
template <int Y>=0A=
class sub_class: public vector<Y>=0A=
{=0A=
int aaa;=0A=
int gg[Y];=0A=
public:=0A=
int yyy;=0A=
#if(Non_BUGGY)=0A=
sub_class();=0A=
#else=0A=
//template <int Y>=0A=
sub_class() {};=0A=
#endif=0A=
// sub_class() {/*vector2<y>();*/ gg[0] =3D -1; aaa =3D -9;}; =0A=
}; // ++++++ sub_class=0A=
=0A=
=0A=
}; // +++++++++++++++=3D top_class=0A=
=0A=
#if(Non_BUGGY)=0A=
template <int Y>=0A=
top_class::sub_class::sub_class() {};=0A=
#endif=0A=
=0A=
main()=0A=
{=0A=
// not possible vector ii;=0A=
vector<20> iij;=0A=
vector<-1> kk(15);=0A=
vector<-1> *def1;=0A=
vector<-1> *undef;=0A=
=0A=
def1 =3D &kk;=0A=
// This is not possible!! def2 =3D &iij; =0A=
=0A=
// undef =3D(vector<9> *) new vector<9>;=0A=
=0A=
iij.put(11,19);=0A=
iij.put(133,20);=0A=
kk.put(12,14);=0A=
kk.put(133,15);=0A=
=0A=
printf("iij:%d\n",iij.get(19));=0A=
printf("kk:%d\n",kk.get(14));=0A=
printf("kk:%d\n",def1->get(14));=0A=
=0A=
printf("iij:%d\n",iij.get(20));=0A=
printf("kk:%d\n",kk.get(15));=0A=
printf("kk:%d\n",def1->get(15));=0A=
=0A=
=0A=
=0A=
}=0A=
------_=_NextPart_000_01C17BD9.9C8FE440
Content-Type: application/octet-stream;
name="bug.ii.gz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="bug.ii.gz"
H4sICOtUBzwAA2J1Zy5paQDFWG1vpDYQ/gy/YrrRRWy0l132JbmEXFSpaqWT0k/9dEojxC5mQ5cA
wpA0jfLfO2MbFoP3JadKJXcBPM8zM54X2+QEXBgsq/X5Ks8Htm2f0Pu44sU4TldJFbIxL8M4O38c
oGAGcxvwR/wSN7rkb6TmRbB+CiAOWVpag5+dk6HiWu75xZV19WU8uRy7M/jj928Dy2jqlY8jFpRV
wfyS8ZK3zUpToJ4MxjpMNOpeWldocTqezIXRXTZjHvghi3rmzHa2aDJxYV1djSeL8XShTDTU//1i
f5esSGHwywDe6L1JFEzdLwfCQEHYMrp32zTNDgj6SJDWZ+7Fh6yL611y3cUxNTNVGroh0J0+PlN7
kUbhLsZ+m2qS0+muHlQTM5fxc+AnMS+Pq+IGTEXsij5xx2i4X8TdMipfc4aJgucsDuHM95UmT5/C
7ONTIIRfBuvjJtCC4xRmYnmZj6cTNYOe23bbd14W1aqE377d/Qrg+3T32t7Pf9D7+ClPPuK+xKP/
l8p/97L23zyDegIx6uE8/geL3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3e39goP4Rye2arMCvz6zIusxGcWXtuEOAuKwhNPybp8xBnk
1TKJV9e2JDhDeAOEwFdI2QuFwbm7G3qExaG7Ow+/EBVS6Ej6eBzzQBGSRBAwpWhH9CZCRvIWEjWO
nAncfKVXOD0VtxtBHpLWe3x/AJJ6tmVZLOEM6tOPc6o+hB6GMBoQ8VMIWVVitmCZVWnI4X6CY8Of
/kwHI2pLoZYUAV7vIgg2lpZznDsFKyushdor0iP8efuPHAJlwfl81RpDN6364b1uVZlhXFp88YRJ
hiaNNoBeEt9vcUgycKGTjGuQcFUlNwKDWkB8BgRB4NXP6/X99wfxVhtQgtfXVzEsXGoUU/m8y3H8
QacFQN3oegri1BkKj5Xt6eQW4vivuqxuPru3sNk47mKoDZ3hp7erj2BIGX1qkgSL5HSz8dQfzVHf
OdWb645cimbzPpuNphMc2Gzk+3TkzluvKBZ2bZXSARKvP4UiX6iCigX1IaCWbzZKjBqEdG6Ukoef
b7eAPfrRvX36F4f0C4BYM/4Fk01NjnoYAAA=
------_=_NextPart_000_01C17BD9.9C8FE440--
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-12-04 5:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-03 21:26 c++/4974: Problem to compile nested heritage of templated cla sses Freissmann Lothar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).