🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Richard W. Kreutzer Mon, 19 Nov 1990 23:38
Incompatible changes in C++
#307
Author: Richard W. Kreutzer
Date: Mon, 19 Nov 1990 23:38
37 lines
1247 bytes
I am not sure, but I think the handling of enum tags may be related to the
problem you (rms) describe concerning struct tags.  The following code will
not compile using g++-1.37.1.

class foo {
private:
  enum Number {ONE = 1, TWO};
  static const NUM = ONE;
public:
  int test();
  };

typedef enum {THREE = 3, FOUR} Number;

int foo::test() {
  Number num = ONE;
  printf("test: num=%d\n", num);
  printf("test: NUM=%d\n", NUM);
}

const NUM = 2;

main() {
  Number num = THREE;
  foo a;
  a.test();
}  


G++ says the typedef for Number is a redefinition.

--

        Richard (Dick) W. Kreutzer
UUCP:   cs.utah.edu!olyis!rwk
Mail:   Olympus Software, Inc.; 1333 E 9400 S; Sandy, UT 84093 (USA)
Phone:  +1 801 572 1610
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads