Archived

This forum has been archived. Please start a new discussion on GitHub.

slice2cpp 3.2.0 conflicts with Ice Manual

Greetings,

Just out of curiosity I tried to follow the description on page 185 of the Ice Manual regarding the Slice mapping of reserved keywords of the target language (C++ in this case).
module else {
  interface while {};
};

compiles fine with slice2cpp (version 3.2.0), but compiling the generated C++ code with g++ (version 4.0.2) fails:
error: ‘_cpp_whilePrx’ does not name a type
error: ‘_cpp_whilePtr’ does not name a type

The two typedefs in the generated header file and several references to "_cpp_whilePtr" in the generated implementation file are incorrect. Since the CHANGES file lists a correction in this respect for Ice 1.5.1, a rock-solid unit test might be in order. ;)

PS: It seems that file Ice-3.2.0/src/slice2cpp/Gen.cpp is affected: methods visitClassDefStart and emitGCClearCode should not use the "keyword-fixed" "name" variable but the unadorned "p->name()" in the relevant places.

Take care,
Andreas

Comments

  • Thanks a lot for the bug report! We'll fix this for the next release.

    Cheers,

    Michi.