Simplify logic in __config by assuming that we are using Clang in C++03 mode. Also, use standardized feature-test macros instead of compiler-specific checks (like __has_feature) in a couple of places.
Details
- Reviewers
ldionne Mordante var-const EricWF - Group Reviewers
Restricted Project - Commits
- rG929d5de22c49: [libc++] Simplify __config a bit
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
In general I like the approach. I want to have a closer look when the CI is green.
libcxx/include/__config | ||
---|---|---|
209 | One of the things bothering about this file is the lack-of overview what indention level parts have. | |
407–408 | nit: maybe use using instead? | |
414 | Can this be really removed? | |
906 | This looks odd, 199711L refers to C++98. When RTTI is disable is it a "random" value or always 0L? |
- Address comments
- Try to fix CI
libcxx/include/__config | ||
---|---|---|
209 | I'm not sure. clang-format indents everything an unneeded level because we have #ifdef __cplusplus around the whole file. What I've formatted here was done mostly by hand. Although I think it still would be a major improvement over the status quo. I don't think anybody (other than Arthur maybe) would actually care if the default indentation is one to far in. So yeah, it's probably a good idea. | |
414 | It looks weird in the diff, but the typedefs are part of the C++03 block above. | |
906 | Neither Clang nor GCC define it actually if RTTI is disabled. The || __cpp_rtti < 199711L is more a technically-correct than anything else. I've been bitten by that before with other FTMs. |
Can you please add a description for this change and avoid making formatting changes in the same patch? It seems interesting, but I can't quite figure out what's the essence of the change in its current state.
SGTM, but I will need some time to have a good look at the changes made.
libcxx/include/__config | ||
---|---|---|
209 | Mainly to make it easier to spot how deeply nested some parts are. Especially in the compiler specific parts. |
I'd like the commit message to explain what's going on here since it's not obvious. From our discussion:
Simplify logic in __config by assuming that we are using Clang in C++03 mode. Also, use standardized feature-test macros instead of compiler-specific checks (like __has_feature) in a couple of places.
LGTM with:
- A more descriptive commit message
- CI passing
- The visibility changes split out.
Thanks a lot, this is actually a really nice refactoring. I am especially looking forward to the split-up patch refactoring visibility attributes.
libcxx/include/__config | ||
---|---|---|
488 | Can you please split the visibility part of this change into another patch? It's really not related to the rest of the patch. |
One of the things bothering about this file is the lack-of overview what indention level parts have.
After processing this patch would it make sense to format this file?
Then all # foo parts have the proper indention.