libcody Now Supports Non-ASCII Module Names
Extends libcody to allow non-ASCII characters in module names, fixing an issue where such characters were incorrectly rejected.
libcody, the C++ module dependency tool, now supports non-ASCII characters in module names. Previously, the parser incorrectly rejected quoted module names containing non-ASCII characters. The fix involves removing a check that restricted characters to the ASCII range and ensuring that character comparisons handle non-ASCII characters correctly.
In Details
This commit modifies buffer.cc and cody.hh in the libcody subsystem (used for handling C++ modules). The S2C function in buffer.cc is responsible for parsing quoted words, and the change removes the c >= 0x7f check. Additionally, unsigned char is used instead of char to ensure that c < 0x20 fails for non-ASCII characters. This resolves PR c++/120458.
For Context
This commit addresses a limitation in how GCC handles C++ modules, specifically when non-ASCII characters are used in module names. C++ modules are a way to organize code into self-contained units, improving build times and code organization. libcody is a component within GCC responsible for managing dependencies between these modules. The fix enables developers to use a broader range of characters in module names, which can be important for internationalization or projects that use non-English identifiers.