Closed tahonermann closed 2 years ago
The paper P2314 got accepted, so what happens now with the CWG issue? Will it be pushed toward C++20?
CWG 2455 should be closed. I've sent e-mail to Mike Miller.
Thank you, @dimztimz, for helping to keep our issue queue clean!
Closing this as resolved by the adoption of P2314 for C++23.
Translation phase 5 states in [lex.phases]p5:
Translation phase 6 states in [lex.phases]p6:
The order of these operations contradicts [lex.string]p12 which states:
The following example is included in table 9:
u"a"
"b"
u"ab"
The wording in translation phases 5 and 6 does not produce the intended result in the above table since
"b"
will have already been converted to the execution character set prior to concatenation.Clang and gcc produce the expected results according to [lex.string]p12. However, MSVC follows translation phase 5 and 6 and first converts the ordinary string literal to the execution character set (and to '?' if not representable), and then concatenates the result encoded as UTF-16.
Additionally, when MSVC is invoked with the
/utf-8
option, The UTF-8 encoded code units in the ordinary string literal are individually interpreted according to the active code page (generally Windows-1252) and then re-encoded as UTF-16. This appears to be a defect in the MSVC compiler.The above differences can be observed with Compiler Explorer: https://msvc.godbolt.org/z/vBdEXq
@steve-downey requested a core issue to be filed on the core mailing list (http://lists.isocpp.org/core/2019/03/5770.php). The new issue hasn't been opened yet, but is expected to be prior to the 2019 Cologne meeting.