[Bug c++/79832] [C++14/17] result of subscripting non lvalue array should be xvalue
listcrawler at gmail dot com
gcc-bugzilla@gcc.gnu.org
Tue Aug 29 08:30:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79832
listcrawler at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |listcrawler at gmail dot com
--- Comment #2 from listcrawler at gmail dot com ---
// bumping bug with some asserts for test bench
#include <type_traits>
#include <utility>
int main ()
{
typedef int U [1];
U u;
static_assert ((std::is_same <U , decltype (u)>::value), "");
static_assert ((std::is_same <U & , decltype ((u))>::value), "");
static_assert ((std::is_same <U && , decltype (std::move (u))>::value),
"");
static_assert ((std::is_same <U , decltype (U {})>::value), "");
static_assert ((std::is_same <int & , decltype (u [0])>::value), "");
static_assert ((std::is_same <int &&, decltype (std::move (u)
[0])>::value), "");
static_assert ((std::is_same <int &&, decltype (U {} [0])>::value), "");
}
More information about the Gcc-bugs
mailing list