When support for declaring the c8rtomb() and mbrtoc8() functions within the std namespace was added in commit 7e7013c5d4b1b3996c8dba668c5a94bb33b2999b, internal glibc macros were used to determine if C2X extensions are enabled. Specifically, a check for whether __GLIBC_USE is defined and whether __GLIBC_USE(ISOC2X) is non-0 was added. __GLIBC_USE is an internal detail of the glibc implementation that may be changed or removed in the future potentially leading to inconsistency or compilation failures. This change removes the use of the internal glibc macro to avoid such problems. Unfortunately, without another mechanism to determine if C2X extensions are enabled, this removal will result in inconsistent declarations of the c8rtomb() and mbrtoc8() functions; when C++ char8_t support is not enabled, but C2X extensions are, these functions will be declared in the global namespace but not in the std namespace. This situation will improve when C23 support is finalized and the check can be re-implemented using __STDC_VERSION__.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
TBH this seems reasonable to me. If this seems reasonable to you, I'll go with your judgement here.
libcxx/include/__config | ||
---|---|---|
1223 | Nitpick, but when you upload your patches, please consider using arc diff so that context is available in the diffs! |
Thanks @ldionne, I'm heading out of town for the weekend, so I'll wait to push this until Monday.
I meant to get this in before the Clang 16 branch, but life and stuff. I'll file an issue to cherry-pick the change for the release branch once committed. Please let me know if you have any thoughts on that.
libcxx/include/__config | ||
---|---|---|
1223 | Oops, I forgot the -U99999 option when generating the diff. |
That sounds fine. The release manager should reach out to me and I'll let them know it's good to go.
Rebase and test update to ignore any declarations present in the global namespace when char8_t support is not enabled.
CI failures are due to test time outs in unrelated tests.
Assuming no new concerns about the added changes to update a test, I'll commit this later today.
Sigh, I forgot to tag the commit with a link to this differential review. Closing manually.
https://github.com/llvm/llvm-project/issues/60517 has been filed to backport this change for the LLVM 16 release.
Nitpick, but when you upload your patches, please consider using arc diff so that context is available in the diffs!