#51 Multi-param macro as enum val

closed-wont-fix
nobody
None
5
2012-11-08
2012-10-17
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
     
  • Jashua Cloutier

    Jashua Cloutier - 2012-11-08
    • status: open --> open-wont-fix
     
  • Jashua Cloutier

    Jashua Cloutier - 2012-11-08

    Sorry, this library wont do any macro expansion which would be required for this bug.

     
  • Jashua Cloutier

    Jashua Cloutier - 2012-11-08
    • status: open-wont-fix --> closed-wont-fix
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks