OSDN Git Service

PR c++/42655
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 14 Jan 2010 20:21:58 +0000 (20:21 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 14 Jan 2010 20:21:58 +0000 (20:21 +0000)
* call.c (convert_like_real): Do full decay_conversion for ck_rvalue.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155913 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/call.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/overload/rvalue1.C [new file with mode: 0644]

index 11fa60d..1374a5b 100644 (file)
@@ -1,3 +1,8 @@
+2010-01-14  Jason Merrill  <jason@redhat.com>
+
+       PR c++/42655
+       * call.c (convert_like_real): Do full decay_conversion for ck_rvalue.
+
 2010-01-13  Dodji Seketeli  <dodji@redhat.com>
 
        PR c++/42634
 2010-01-13  Dodji Seketeli  <dodji@redhat.com>
 
        PR c++/42634
index 02fc4b3..935aea8 100644 (file)
@@ -5013,7 +5013,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
   switch (convs->kind)
     {
     case ck_rvalue:
   switch (convs->kind)
     {
     case ck_rvalue:
-      expr = convert_bitfield_to_declared_type (expr);
+      expr = decay_conversion (expr);
       if (! MAYBE_CLASS_TYPE_P (totype))
        return expr;
       /* Else fall through.  */
       if (! MAYBE_CLASS_TYPE_P (totype))
        return expr;
       /* Else fall through.  */
index cfebc86..7c747c3 100644 (file)
@@ -1,3 +1,8 @@
+2010-01-14  Jason Merrill  <jason@redhat.com>
+
+       PR c++/42655
+       * g++.dg/overload/rvalue1.C: New.
+
 2010-01-14  Martin Jambor  <mjambor@suse.cz>
 
        PR tree-optimization/42706
 2010-01-14  Martin Jambor  <mjambor@suse.cz>
 
        PR tree-optimization/42706
diff --git a/gcc/testsuite/g++.dg/overload/rvalue1.C b/gcc/testsuite/g++.dg/overload/rvalue1.C
new file mode 100644 (file)
index 0000000..4180594
--- /dev/null
@@ -0,0 +1,10 @@
+// PR c++/42655
+
+void unused(const bool &) { }
+
+int main() {
+  volatile bool x = false;
+  unused(!!x); // type of "!x" is bool
+  unused(!x); // type of "!x" is bool
+}
+