<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/80560>80560</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libc++] __bit_reference template parameter conflicting with netcdf
</td>
</tr>
<tr>
<th>Labels</th>
<td>
libc++,
quality-of-implementation
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
DimitryAndric
</td>
</tr>
</table>
<pre>
As of 4d20cfcf4eb08217ed37c4d4c38dc395d7a66d26, `__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](https://www.unidata.ucar.edu/software/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](https://github.com/Unidata/netcdf-cxx4) 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 4d20cfcf4eb08217ed37c4d4c38dc395d7a66d26.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVUFv4zYT_TX0ZRBDpizbOviQ2BCwwOL70MO2x4AiR9Y0FKklR3H874uRtsm6DVr0YsEm9ea9N2_GJme6BMSjqp5UdV6ZifuYjmcaiNPtMbhEdtVGdzs-ZogdbJ0ubGe7LbbFQW_26Mq93bqtLQ_OlnXl9ma3c3qn9AnUrnh-bomfE3aYMFhUuwJsDGwoZDDAOIzeMC43O_L-OciVK3EPBtoY_XzUkPe_Gj_N748mmQEZ01oVZ1U8Lp_fQhcTT8Ew-htwjwmBpEZCb5he5dcrOXlMGR2MhBZFULaEgakjCzl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