re PR target/43070 (g++.dg/ext/label2.C fails to compile at -O1)
authorJason Merrill <jason@redhat.com>
Thu, 18 Feb 2010 19:20:21 +0000 (14:20 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 18 Feb 2010 19:20:21 +0000 (14:20 -0500)
PR c++/43070
* semantics.c (finish_goto_stmt): Don't call decay_conversion.

From-SVN: r156872

gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/label1.C
gcc/testsuite/g++.dg/ext/label2.C

index 1fdeef498b3e0c0b3bcb1bf46d2265965f70d061..a54d30aaf68aace6ad373cf3fec31fbcddd4a49e 100644 (file)
@@ -1,5 +1,8 @@
 2010-02-18  Jason Merrill  <jason@redhat.com>
 
+       PR c++/43070
+       * semantics.c (finish_goto_stmt): Don't call decay_conversion.
+
        PR c++/26261
        PR c++/43101
        * pt.c (tsubst_qualified_id): Do normal lookup in non-dependent scope.
index 24390d98c0c4f3349f00596d7eaa7bcef582aade..5d8b767b272bc4f59c074ca46f3c56f2513c7606 100644 (file)
@@ -546,10 +546,8 @@ finish_goto_stmt (tree destination)
     TREE_USED (destination) = 1;
   else
     {
-      /* The DESTINATION is being used as an rvalue.  */
       if (!processing_template_decl)
        {
-         destination = decay_conversion (destination);
          destination = cp_convert (ptr_type_node, destination);
          if (error_operand_p (destination))
            return NULL_TREE;
index 4225d998ce0434031c2984047c413a1ac4768eca..f3957e15c0a9d9e47b98e9efa2f698105b868604 100644 (file)
@@ -1,5 +1,9 @@
 2010-02-18  Jason Merrill  <jason@redhat.com>
 
+       PR c++/43070
+       * g++.dg/ext/label1.C: Update.
+       * g++.dg/ext/label2.C: Update.
+
        PR c++/26261
        * g++.dg/template/dependent-name6.C: New.
 
index 8c6684dce0e7dd4baa54842c1a3cf5ae36ed91b1..95fd644e28ae03ebcb197de83adad0969219ada0 100644 (file)
@@ -2,7 +2,9 @@
 
 int main(void) {
   static const void* lbls[2][2] = {{&&lbl0, &&lbl0}, {&&lbl0, &&lbl0}};
-  goto *lbls[0];
+  goto *lbls[0][0];
+  goto *lbls[0][0][0];         // { dg-message "" }
+  goto *lbls[0];               // { dg-error "" }
  lbl0:
   ;
 }
index 1b66f603fe464c6ba55ea69edf54a2a7ff31456a..7d11d00f52eebad1b1bbf17c200f566365805aa7 100644 (file)
@@ -5,7 +5,7 @@ void f() {
  l:
   void *p[] = { &&l };
 
-  goto *p;
+  goto *p[0];
 }
 
 template void f<int>();