facebook / facebook/folly

clang warning in F14 with C++20

Open
#1,536 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
30.5k
Forks
5.9k
PR merge metrics
No merged PRs in 30d

Description

```
ISO C++20 considers use of overloaded operator '!=' (with operand types 'folly::f14::detail::VectorContainerIterator, rockset::NodeInfo> *>' and 'folly::f14::detail::F14BasicMap, rockset::NodeInfo, folly::transparent>>, folly::transparent>>, void, std::integral_constant>>::iterator' (aka 'folly::f14::detail::VectorContainerIterator, rockset::NodeInfo> *>')) to be ambiguous despite there being a unique best viable function with non-reversed arguments(-Wambiguous-reversed-operator)
F14Policy.h(942, 8): Candidate function with non-reversed arguments
F14Policy.h(939, 8): Ambiguous candidate function with reversed arguments
```

version of the code where the line numbers are correct: https://github.com/facebook/folly/blame/e741d8efa0052df83c187331745dd4441c693fcb/folly/container/detail/F14Policy.h#L939

I suspect that this is because C++20 now adds more operators to the candidate set, and they all have to go through the `VectorContainerIterator` -> `VectorContainerIterator` conversion, which makes them ambiguous, in a way similar to https://stackoverflow.com/questions/60568088/breaking-change-in-c20-or-regression-in-clang-trunk-gcc-trunk-when-overloading

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.