[libcxx-commits] [libcxx] [libcxxabi] [libc++][RFC] Always define internal feature test macros (PR #89178)
via libcxx-commits
libcxx-commits at lists.llvm.org
Thu May 2 14:30:35 PDT 2024
EricWF wrote:
I have a preference for the existing mechanisms. They've not caused my any trouble in my time on the project.
I think the existing mechanisms encourage/enforce the use of negative feature test macro names (ex. `_LIBCPP_HAS_NO_EXCEPTIONS`). I believe this naming scheme helps avoid misspelling/misconfiguration bugs,
since a misspelled guard will almost certainly cause a compilation failure. I worry the proposed approach isn't as robust against this.
This would change very long standing existing practice, which according to my recollection hasn't caused any major problems. Generally the macros are specified in the negative form (ex. _LIBCPP_HAS_NO_EXCEPTIONS), so they're only defined when a feature isn't available.
Because the current practice is so long standing, I would like this change to come with a clang-tidy that looked for misapplication of `#ifdef` to libc++ macros.
https://github.com/llvm/llvm-project/pull/89178
More information about the libcxx-commits
mailing list