These workarounds make it impractical to granularize math.h and we don't support Solaris anyways.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
@jperkin Looking at https://github.com/illumos/illumos-gate/blob/master/usr/src/head/iso/math_iso.h (I hope that's the correct code) it seems trivial to remove the float/long double overloads when included through libc++, or add a macro like _ILLUMOS_NO_CPP_MATH_OVERLOADS to disable them. This would also make it a lot easier to implement P0533R9 on your platform, since you wouldn't have to do anything (at least with libc++) and make it a lot simpler for libc++ to move the code around without having to add workarounds. I didn't look at what you do with libstdc++, but I'd be surprised if it wasn't easier to let them provide the overloads as well.
I wouldn't consider this a duplicate. It's a subset of what you try to do in D138680. Here I only remove workarounds that are problematic to changes I want to make to libc++ while D138680 removes all support code for Solaris (and derivatives). For the workarounds I want to remove I also propose a proper fix on the Illumos side of things (I assume other Solaris versions can be fixed in a similar way), see my previous comment.
Please see my latest comment in D138680. I don't want us to go halfway since that's just pushing the pain further down the road. We either support Solaris or we don't, and if we don't, I see no reason to remove some but not all the workarounds for that platform.
And if we do, then this patch can't ship as-is because it'll break Solaris, which we would then support.