Skip to content

[libc++] __bit_reference template parameter conflicting with netcdf #80560

Closed
@DimitryAndric

Description

@DimitryAndric

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.quality-of-implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions