🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

parse bug refering to operator-function-names

#897
From: Lewis G. Pringle
Date: Thu, 03 Sep 1992 19:59
30 lines
1140 bytes
// When compiling this program with g++ 2.2.1:
// g++ -c a.cc yeilds:
//	a.cc: In function `void  test ()':
//	a.cc:29: structure has no member named `'
// for the final call to SmartPointer::operator -> (); Although
// this syntax is wierd, it is clearly permitted by the syntax in
// ARM 17.2 (operator-function-name is "operator ->", and name
// can be an operator-function-name).

struct Object {
  int a;
};


struct SmartPointer {
  Object* p;
  Object* operator-> ();
  Object* Peek ();
};



void test ()
{
  SmartPointer s;

  Object* o1 = s.Peek ();
  s->a = 1;
  Object* o2 = s.operator-> ();	// I am line 29 - why am I wrong?
}
Technical Details
Message-ID: <m0mQNLE-000AWzC@sophists.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!usc!sdd.hp.com!swrinde!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!sophists.COM!lewis

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!usc!sdd.hp.com!swrinde!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!sophists.COM!lewis
From: lewis@sophists.COM (Lewis G. Pringle)
Newsgroups: gnu.g++.bug
Subject: parse bug refering to operator-function-names
Message-ID: <m0mQNLE-000AWzC@sophists.com>
Date: 3 Sep 92 19:59:00 GMT
Sender: gnulists@ai.mit.edu
Reply-To: lewis@sophists.com
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 30
Approved: bug-g++@prep.ai.mit.edu