Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* Compiler bug in DEC C++??? (supplemented)
@ 1994-06-17 14:06 zeisel
  1994-06-18  5:48 ` jmack
  1994-06-29 17:46 ` harold seigel
  0 siblings, 2 replies; 4+ messages in thread
From: zeisel @ 1994-06-17 14:06 UTC (permalink / raw)


The following code gives a run time error ``access violation''
using DEC C++ V1.3-0 on an ALPHA OpenVMS V1.5-1H1 machine,
but works fine using DEC C++ V1.1-001 on a VAX.

Is this a compiler bug or is there something wrong with my program?

Newsfeed unreliable, please answer also via E Mail.
Thanx,

Helmut Zeisel     zeisel@indmath.uni-linz.ac.at

----------------------------------------------------------------------
#define VERSION 1

#include <fstream.h>
#define DUMP(A) cout << #A << " = " << A << endl;

class ClassA
{
  double a;
public:
  ClassA(double b)
  {
    a=b;
  }
  double get() const
  {
    return a;
  }
};

typedef double (ClassA::*PTMF)() const;


class ClassB
{
private:

#if (VERSION == 1)
  ClassA * pvAH;
#endif

  PTMF fct;

#if (VERSION == 2)
  ClassA * pvAH;
#endif

public:
  ClassB::ClassB(ClassA * aH, PTMF f)
  {
    fct = f;
    DUMP((aH->*f)());
    DUMP((aH->*fct)());
  }
}; // class ClassB

main()
{
  ClassA a(123.45);
  ClassB b(&a,&ClassA::get);
}
----------------------------------------------------------------------
-------------------------------------------------------------------
Helmut Zeisel                         zeisel@indmath.uni-linz.ac.at
Institut fuer Mathematik
Universitaet Linz
A-4040 Linz                                  Tel  +43-732-2468-9225
AUSTRIA/EUROPE                               Fax     +43-732-246810



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1994-06-29 17:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-06-17 14:06 Compiler bug in DEC C++??? (supplemented) zeisel
1994-06-18  5:48 ` jmack
1994-06-20 22:24   ` alan
1994-06-29 17:46 ` harold seigel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox