OSDN Git Service

PR c++/43070
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 18 Feb 2010 19:20:21 +0000 (19:20 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 18 Feb 2010 19:20:21 +0000 (19:20 +0000)
* semantics.c (finish_goto_stmt): Don't call decay_conversion.

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

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 1fdeef4..a54d30a 100644 (file)
@@ -1,5 +1,8 @@
 2010-02-18  Jason Merrill  <jason@redhat.com>
 
 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.
        PR c++/26261
        PR c++/43101
        * pt.c (tsubst_qualified_id): Do normal lookup in non-dependent scope.
index 24390d9..5d8b767 100644 (file)
@@ -546,10 +546,8 @@ finish_goto_stmt (tree destination)
     TREE_USED (destination) = 1;
   else
     {
     TREE_USED (destination) = 1;
   else
     {
-      /* The DESTINATION is being used as an rvalue.  */
       if (!processing_template_decl)
        {
       if (!processing_template_decl)
        {
-         destination = decay_conversion (destination);
          destination = cp_convert (ptr_type_node, destination);
          if (error_operand_p (destination))
            return NULL_TREE;
          destination = cp_convert (ptr_type_node, destination);
          if (error_operand_p (destination))
            return NULL_TREE;
index 4225d99..f3957e1 100644 (file)
@@ -1,5 +1,9 @@
 2010-02-18  Jason Merrill  <jason@redhat.com>
 
 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.
 
        PR c++/26261
        * g++.dg/template/dependent-name6.C: New.
 
index 8c6684d..95fd644 100644 (file)
@@ -2,7 +2,9 @@
 
 int main(void) {
   static const void* lbls[2][2] = {{&&lbl0, &&lbl0}, {&&lbl0, &&lbl0}};
 
 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:
   ;
 }
  lbl0:
   ;
 }
index 1b66f60..7d11d00 100644 (file)
@@ -5,7 +5,7 @@ void f() {
  l:
   void *p[] = { &&l };
 
  l:
   void *p[] = { &&l };
 
-  goto *p;
+  goto *p[0];
 }
 
 template void f<int>();
 }
 
 template void f<int>();