DOCGroup / ACE_TAO

ACE and TAO
https://www.dre.vanderbilt.edu/~schmidt/TAO.html
704 stars 380 forks source link

Using C++ keywords with AMI results in uncompilable generated code #1050

Open jwillemsen opened 4 years ago

jwillemsen commented 4 years ago

amikeywordbug.txt

See attached patch for a test extension

/home/johnny/ACE/trunk/TAO/tests/AMI/ami_testS.cpp: In member function ‘virtual const TAO_2_5_8::TAO_operation_db_entry* TAO_A_AMI_Test_Perfect_Hash_OpTable::lookup(const char*, unsigned int)’:
/home/johnny/ACE/trunk/TAO/tests/AMI/ami_testS.cpp:113:41: error: ‘_get_return_skel’ is not a member of ‘POA_A::AMI_Test’
  113 |       {"_get_return", &POA_A::AMI_Test::_get_return_skel, 0},
      |                                         ^~~~~~~~~~~~~~~~
/home/johnny/ACE/trunk/TAO/tests/AMI/ami_testS.cpp:114:41: error: ‘_set_return_skel’ is not a member of ‘POA_A::AMI_Test’
  114 |       {"_set_return", &POA_A::AMI_Test::_set_return_skel, 0},
      |                                         ^~~~~~~~~~~~~~~~
/home/johnny/ACE/trunk/TAO/tests/AMI/ami_testS.cpp: In member function ‘virtual const TAO_2_5_8::TAO_operation_db_entry* TAO_A_Test_Child_Perfect_Hash_OpTable::lookup(const char*, unsigned int)’:
/home/johnny/ACE/trunk/TAO/tests/AMI/ami_testS.cpp:2469:41: error: ‘_get_return_skel’ is not a member of ‘POA_A::AMI_Test’
 2469 |       {"_get_return", &POA_A::AMI_Test::_get_return_skel, 0},
      |                                         ^~~~~~~~~~~~~~~~
/home/johnny/ACE/trunk/TAO/tests/AMI/ami_testS.cpp:2470:41: error: ‘_set_return_skel’ is not a member of ‘POA_A::AMI_Test’
 2470 |       {"_set_return", &POA_A::AMI_Test::_set_return_skel, 0},
      |                                         ^~~~~~~~~~~~~~~~
jwillemsen commented 4 years ago

TAO_IDL should first apply the implied IDL rules, after that the C++ escaping, so with an attribute return the resulting C++ should contain get_return/set_return

iguessthislldo commented 4 years ago

I had a similar problem with annotations that I fixed in #918: https://github.com/DOCGroup/ACE_TAO/commit/7a28f35fdb3c9fd0213ae4e13386c9238478f08c#diff-9adbd82323a85e56783d9bcfa9726741 (Note: I misspelled clash).

iguessthislldo commented 4 years ago

Although this looks like a different escaping mechanism, so maybe my reference isn't really that helpful.