Boost. 1.91.0 regression: optional<bool> copy constructor broken
- Dominant language
- C++
- Stars
- 60
- Forks
- 75
- PR merge metrics
- No merged PRs in 30d
Description
Consider the following code:
```
const boost::optional constValue;
assert(!constValue.has_value()); // succeeds
boost::optional mutableValue(constValue);
assert(!mutableValue.has_value()); // succeeds
boost::optional mutableCopy(mutableValue);
assert(!mutableCopy.has_value()); // fails
```
The reason is that the wrong constructor is taken for `boost::optional(boost::optional&)`:
https://github.com/boostorg/optional/blob/88e2378c8a9a45d4617d9386619677038b392ff1/include/boost/optional/detail/union_optional.hpp#L391
instead of
https://github.com/boostorg/optional/blob/88e2378c8a9a45d4617d9386619677038b392ff1/include/boost/optional/detail/union_optional.hpp#L293.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.