This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/79832] [C++14/17] result of subscripting non lvalue array should be xvalue
- From: "listcrawler at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 29 Aug 2017 08:17:33 +0000
- Subject: [Bug c++/79832] [C++14/17] result of subscripting non lvalue array should be xvalue
- Auto-submitted: auto-generated
- References: <bug-79832-4@http.gcc.gnu.org/bugzilla/>
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), "");
}