🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

default initializers

#437
From: Michael Tiemann
Date: Tue, 19 Sep 1989 17:13
57 lines
1726 bytes
   Date: 15 Sep 89 16:40:43 GMT
   From: lijewski@tcgould.tn.cornell.edu  (Mike Lijewski)
   Organization: Cornell National Supercomputer Facility
   Sender: bug-g++-request@prep.ai.mit.edu

   The docuentation on default initializers seems somewhat fuzzy
   on this issue, though I would expect the following to work.
   Unfortunately, it seems that only one declaration of ff() is
   remembered after it's initial definition.
Wrong diagnosis; see below.

   Script started on Fri Sep 15 12:30:08 1989

   robbie(1)->cat a.cc

   #include <stream.h>

   void ff(int i, int j, int k)
   {
     cout << i << " " << j << " " << k << "\n";
   }

   void ff(int, int, int = 7);
   void ff(int , int = 6, int);
   void ff(int = 5, int, int);

   main()
   {
     ff();

     return 0;
   }

This works:

   void ff(int, int, int = 7);
   void ff(int , int = 6, int = 7);
   void ff(int = 5, int = 6, int = 7);

As does this:

   void ff(int = 5, int = 6, int = 7);
   void ff(int, int = 6, int = 7);
   void ff(int, int, int = 7);

In both cases, what is remembered is

   void ff(int = 5, int = 6, int = 7);

It is terribly confusing to see

   void ff(int , int = 6, int);

so I did not have the compiler recognize it.

Michael
Technical Details
Message-ID: <8909191713.AA01550@teacake.sun.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!SUN.COM!tiemann
References: <8867@batcomputer.tn.cornell.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!SUN.COM!tiemann
From: tiemann@SUN.COM (Michael Tiemann)
Newsgroups: gnu.g++.bug
Subject: default initializers
Message-ID: <8909191713.AA01550@teacake.sun.com>
Date: 19 Sep 89 17:13:12 GMT
References: <8867@batcomputer.tn.cornell.edu>
Sender: daemon@tut.cis.ohio-state.edu
Reply-To: tiemann@sun.com
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 57