-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[libc++] __bit_reference template parameter conflicting with netcdf #80560
Comments
I'm fine with it if you want to provide a small patch. This should still be fixed by the library to avoid future problems. @AaronBallman is there a reason not even |
Pull request: #80661 |
We disable
(I'd have to give it more thought.) Because you're right, this problem comes up quite often and I think we need to start being more aggressive about warning on reserved identifiers in general. (A reservation only works in practice if users actually know about it!) |
Fixed with 1ec2522. |
As of 4d20cfc,
__bit_reference
contains a template__fill_n
with a bool_FillValue
parameter.Unfortunately there is a relatively widely used piece of scientific software called NetCDF, which exposes a (C) macro
_FillValue
in its public headers: https://github.com/Unidata/netcdf-c/blob/main/include/netcdf.h#L113 .When building the NetCDF C++ bindings this quickly leads to compilation errors when the macro interferes with the template in
__bit_reference
.I have mentioned this to them in Unidata/netcdf-c#2858, but it looks like it will be pretty difficult to change, not in the least because it is likely that external consumers of this library also depend on the macro.
Of course identifiers starting with underscores are reserved, but in this case it might not be that impactful for libc++ to rename the template parameter to something slightly different, and non-conflicting? I would count this as a minor QoL fix.
CC @philnik777 who is the author of 4d20cfc.
The text was updated successfully, but these errors were encountered: