ACE_TAO
ACE_TAO copied to clipboard
TAO_IDL Wide Char Literal Escapes
While testing that the IDL I wrote for this PR was correct, I found that there is TAO_IDL can't compile wide character literals with escapes in them:
const wchar m = L'i';
const wchar n = L'\n';
const wchar o = L'\'';
Running it results in:
Error - tao_idl: "wide_char_issue.idl", line 2: error in lookup of symbol: L
tao_idl: wide_char_issue.idl: found 1 error
Commenting out n
line results in:
syntax error
Error - tao_idl: "wide_char_issue.idl", line 3: Malformed const declaration
Commenting out o
line, results in success.
Besides isolating the issues, I haven't look into this further, but I suspect that escapes aren't properly implemented for wide character literals, or perhaps are not implemented all.
This looks legal IDL to me, it is accepted by ridlc
Some additional info: While testing C++11 character literals in OpenDDS, I noticed that it does accept the 'u' escape:
const wchar c = L'\u203C';
Which allows our C++11 mapping to work after I updated it to print char literals correctly:
constexpr wchar_t c = L'\x203c';
tao_idl
silently emits invalid C++:
const CORBA::WChar c = L';