🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #206

another bug with templates (PS)

#206
From: Marvin Solomon
Date: Fri, 07 Aug 1992 02:39
14 lines
834 bytes
The previous program I sent was invalid C++.  Adding another declaration
for operator<< makes it valid (e.g., cfront 3.0.1 accepts it without any
warnings even with +w), but it still crashes g++ 2.2.2.

struct S { int a; };

template <class T> struct Temp { void f(); };

template <class T> void operator<< (S &, Temp<T> &);
void operator<< (S&, int&);

template <class T> void Temp<T>::f() { S s; int t; s << t; }

Temp<float> foo;
Technical Details
Message-ID: <9208071239.AA10808@gjetost.cs.wisc.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cs.wisc.edu!solomon

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cs.wisc.edu!solomon
From: solomon@cs.wisc.edu (Marvin Solomon)
Subject: another bug with templates (PS)
Message-ID: <9208071239.AA10808@gjetost.cs.wisc.edu>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Fri, 7 Aug 1992 02:39:40 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 15