[libc++] Declarations of `error_condition` and `path::iterator` cause issues with visibility pragmas
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
https://github.com/llvm/llvm-project/pull/132602 removed visibility attributes from certain declarations (`error_condition` and `filesystem::path::iterator`). This creates an inconsistency between the declaration and the definition (which still has the attribute) if a user changes the default visibility via a pragma. The following code demonstrates both of these issues ([Godbolt](https://godbolt.org/z/48z454dn5)):
```cpp
#pragma GCC visibility push(hidden)
#include
```
```
<...>/error_condition.h:49:7: error: visibility does not match previous declaration
49 | class _LIBCPP_EXPORTED_FROM_ABI error_condition {
| ^
<...>/path_iterator.h:26:7: error: visibility does not match previous declaration
26 | class _LIBCPP_EXPORTED_FROM_ABI path::iterator {
| ^
```
While this pragma is a non-standard extension, it seems like supporting it is rather easy.
Contributor guide
Assessment
This issue has not been assessed yet.