aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2016-07-23 22:25:36 -0400
committerJason Merrill <jason@gcc.gnu.org>2016-07-23 22:25:36 -0400
commit478ed1fae766c27d0ce0fbf13d104a0011a8382e (patch)
tree66a9c3ba6536a6b5bf788a571643a96b39158be6
parent76178f67679d1a13ef472795c47547378fa67b40 (diff)
downloadgcc-478ed1fae766c27d0ce0fbf13d104a0011a8382e.zip
gcc-478ed1fae766c27d0ce0fbf13d104a0011a8382e.tar.gz
gcc-478ed1fae766c27d0ce0fbf13d104a0011a8382e.tar.bz2
PR c++/71576 - bitfield and rvalue reference
* call.c (convert_like_real): Use lvalue_kind. From-SVN: r238683
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/call.c2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/rv-bitfield3.C14
3 files changed, 18 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 75d9108..34ebcb8 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,8 @@
2016-07-22 Jason Merrill <jason@redhat.com>
+ PR c++/71576
+ * call.c (convert_like_real): Use lvalue_kind.
+
PR c++/71748
PR c++/52746
* pt.c (tsubst_baselink): Call
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 061e708..2f373a3 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -6737,7 +6737,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
for a non-reference copy-initialization (8.5). */
tree type = TREE_TYPE (ref_type);
- cp_lvalue_kind lvalue = real_lvalue_p (expr);
+ cp_lvalue_kind lvalue = lvalue_kind (expr);
gcc_assert (same_type_ignoring_top_level_qualifiers_p
(type, next_conversion (convs)->type));
diff --git a/gcc/testsuite/g++.dg/cpp0x/rv-bitfield3.C b/gcc/testsuite/g++.dg/cpp0x/rv-bitfield3.C
new file mode 100644
index 0000000..9d2d872
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/rv-bitfield3.C
@@ -0,0 +1,14 @@
+// PR c++/71576
+// { dg-do compile { target c++11 } }
+
+template < typename T > T && foo ();
+
+struct A
+{
+ int i:5;
+};
+
+void foo ()
+{
+ int &&j = foo < A > ().i;
+}