Opened 7 years ago
Closed 6 years ago
#11751 closed Bugs (fixed)
variant of non-const references fails equality compare
Reported by: | Owned by: | Antony Polukhin | |
---|---|---|---|
Milestone: | Boost 1.62.0 | Component: | variant |
Version: | Boost 1.59.0 | Severity: | Problem |
Keywords: | variant | Cc: |
Description
The following aborts:
#include <boost/variant.hpp> using variant_type = boost::variant< int& >; int main () { int a, b; variant_type v (a), u (b); v == u; return 0; }
Compile and run:
$ g++ -std=c++14 -I/opt/boost/default/include t.cpp && ./a.out a.out: /opt/boost/default/include/boost/variant/detail/forced_return.hpp:39: T boost::detail::variant::forced_return() [with T = const int&]: Assertion `false' failed. Aborted (core dumped)
It seems that the cause is the instantiation of known_get for const T at line 905 in variant.hpp (1.59.0).
Change History (4)
comment:1 by , 7 years ago
Component: | None → variant |
---|---|
Owner: | set to |
comment:2 by , 6 years ago
Milestone: | To Be Determined → Boost 1.62.0 |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:3 by , 6 years ago
comment:4 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
Fixed in 082732aa develop, will be merged to master as soon as the tests will cycle.