Title
Problem in example in 9
Status
cd1
Section
11.4.10 [class.bit]
Submitter
Roberto Santos

Created on 2003-10-10.00:00:00 last changed 161 months ago

Messages

Date: 2004-10-15.00:00:00

[Voted into WP at October 2004 meeting.]

Date: 2004-04-09.00:00:00

It looks like the example on 11.4.10 [class.bit] paragraph 4 has both the enum and function contributing the identifier "f" for the same scope.

  enum BOOL { f=0, t=1 };
  struct A {
    BOOL b:1;
  };
  A a;
  void f() {
    a.b = t;
    if (a.b == t) // shall yield true
    { /* ... */ }
  }

Proposed resolution:

Change the example at the end of 11.4.10 [class.bit]/4 from:

  enum BOOL { f=0, t=1 };
  struct A {
    BOOL b:1;
  };
  A a;
  void f() {
    a.b = t;
    if (a.b == t) // shall yield true
    { /* ... */ }
  }

To:

  enum BOOL { FALSE=0, TRUE=1 };
  struct A {
    BOOL b:1;
  };
  A a;
  void f() {
    a.b = TRUE;
    if (a.b == TRUE) // shall yield true
    { /* ... */ }
  }

History
Date User Action Args
2008-10-05 00:00:00adminsetstatus: wp -> cd1
2005-05-01 00:00:00adminsetstatus: dr -> wp
2004-11-07 00:00:00adminsetmessages: + msg1096
2004-11-07 00:00:00adminsetstatus: ready -> dr
2004-04-09 00:00:00adminsetstatus: open -> ready
2003-10-10 00:00:00admincreate