#51 Multi-param macro as enum val

closed-wont-fix
nobody
None
5
2012-11-08
2012-10-17
Gregory Borges
No

Enum values that are macros with multiple parameters cause a parsing problem. Parsing the code below reports "B" and "C" as enumeration values for the "MyEnum" enum.

#define SOME_OP( a, b, c, d ) ((a)+(b)+(c)+(d))

const int A = 1;
const int B = 2;
const int C = 3;
const int D = 4;

class Sample33 {
enum MyEnum {
MAX_VAL = SOME_OP( A, B, C, D )
};
};

Discussion

  • Gregory Borges
    Gregory Borges
    2012-10-17

     
    Attachments
    • status: open --> open-wont-fix
     
  • Sorry, this library wont do any macro expansion which would be required for this bug.

     
    • status: open-wont-fix --> closed-wont-fix