www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/24/17:49:48

Message-ID: <38B57379.817FFBE4@netcom.ca>
From: MM <mm AT netcom DOT ca>
X-Mailer: Mozilla 4.5 [en] (Win95; I)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Possible Compiler Bug
Lines: 64
Date: Thu, 24 Feb 2000 13:07:53 -0500
NNTP-Posting-Host: 207.181.88.129
X-Complaints-To: abuse AT netcom DOT ca
X-Trace: tor-nn1.netcom.ca 951415471 207.181.88.129 (Thu, 24 Feb 2000 13:04:31 EDT)
NNTP-Posting-Date: Thu, 24 Feb 2000 13:04:31 EDT
Organization: Netcom Canada
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

This is a multi-part message in MIME format.
--------------86D443F43BE349DB1569415A
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

The file I've attached causes djgpp to kill the compiler and tell me to
submit a full bug report.  I would do so, but first I want to make sure
this happens to others as well.  If you could please take a look at the
code and tell me what I'm doing wrong or if it shouldn't be done like
that at all to begin with I'd greatly appreciate it.
Thanks,

--------------86D443F43BE349DB1569415A
Content-Type: text/plain; charset=us-ascii;
 name="bug.cc"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="bug.cc"

#include <iostream.h>

class t
{
   private:
      int a;
   public:
      t (void) : a (10) { };

      void selectfunc (int w);
      void multifunc (void);
      void (t::*funcptr)(void);

      void func1 (void);
      void func2 (void);
      void func3 (void);
};

void t::func1 (void) { cout << "Func1 " << a << endl; }
void t::func2 (void) { cout << "Func2 " << a << endl; }
void t::func3 (void) { cout << "Func3 " << a << endl; }

void t::selectfunc (int w)
{
   switch (w)
   {
      case 1: funcptr = &func1; break;
      case 2: funcptr = &func2; break;
      case 3: funcptr = &func3; break;
   }
}

void t::multifunc (void)
{
   this->funcptr ();
}

int main (void)
{

   return (0);
}

--------------86D443F43BE349DB1569415A--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019