https://bugs.kde.org/show_bug.cgi?id=472329

--- Comment #3 from m <kde.si...@dralias.com> ---
I can reduce the test-case further, replacing the map with set, and dropping
the lambda wrapper. However, further reductions easily cause the optimizer to
eat all code before it gets compiled into the binary. Currently I have:

```cpp
#include <cstdint>
#include <iostream>
#include <optional>
#include <set>
#include <string>
void foo(std::optional<int64_t> f) {
  std::cout << (f ? *f : 0) << std::endl;
  std::set<std::pair<int64_t, int64_t>> test;
  test.emplace(std::pair{0, 0});
  auto it{test.begin()};
  while (it != test.end()) {
    int64_t b{it->second};
    if (f && *f != b) {
      it++;
      break;
    }
    std::cout << "";
    it++;
  }
}
int main() { foo(std::nullopt); }
```

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to