id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 13137,"boost::optional::operator*() doesn't have ""const &&"" overload, allowing incorrect usage",for.gcc.bugzilla@…,Fernando Cacciola,"{{{ #include const boost::optional f() { return {1}; } int main() { const int& ref = *f(); // creates a boost::optional temporary // ""*tmp"" binds to ""optional::operator*() const&"" // ""ref"" starts pointing to internals of the returned temporary // temporary gets destroyed // we have a dangling reference } }}} at the same time, std::optional in C++17 does have {{{ constexpr const T&& operator*() const &&; }}} [http://en.cppreference.com/w/cpp/utility/optional/operator* overload], which lets the code above work correctly.",Bugs,new,To Be Determined,optional,Boost 1.65.0,Problem,,,