home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / progc / fixed300.arj / SLZBUGC2.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1991-06-26  |  920 b   |  45 lines

  1. #if 0
  2. From: Scott Ladd
  3. Subject: far static member functions
  4. Status: Fixed in 3.0
  5. #endif
  6.  
  7. /*
  8.       This is a VERY serious bug in how ZTC handles function pointers to
  9.       static member functions. When compiled with:
  10.  
  11.           ztc slz3bugc.cpp
  12.  
  13.       The following error is emitted:
  14.  
  15.           ztcpp1x -oe:\ztc_1.tmp slz3bugc.cpp
  16.           FPtr fp = X::Function;
  17.                        ^
  18.           slz3bugc.cpp(16) : Error: cannot implicitly convert
  19.           from:<near *><near C++ func(<int>) returning><int>
  20.           to  :<_pascal far *><_pascal far Pascal func(<int>) returning><int>
  21.  
  22.           --- errorlevel 1
  23. */
  24.  
  25.  
  26. class X
  27.     {
  28.     public:
  29.         static int _far _pascal Function(int x);
  30.     };
  31.  
  32. int _far _pascal X::Function(int x)
  33.     {
  34.     return x;
  35.     }
  36.  
  37. typedef int (_far _pascal * FPtr)(int x);
  38.  
  39. int main()
  40.     {
  41.     FPtr fp = X::Function;
  42.  
  43.     return 0;
  44.     }
  45.