OSDN Git Service

2005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 3 Nov 2005 15:06:42 +0000 (15:06 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 3 Nov 2005 15:06:42 +0000 (15:06 +0000)
        PR c++/24582
        * g++.dg/init/switch1.C: New test.

2005-11-03  Andrew Pinski  <pinskia@physics.uc.edu>

        PR c++/24582
        * decl.c (declare_local_label): Return 0 for variables
        with error_mark_node as their types.

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

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/init/switch1.C [new file with mode: 0644]

index eb52015..e1edc45 100644 (file)
@@ -1,3 +1,9 @@
+2005-11-03  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR c++/24582
+       * decl.c (declare_local_label): Return 0 for variables
+       with error_mark_node as their types.
+
 2005-11-02  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/22434
index 7e38ec3..c5fe658 100644 (file)
@@ -2147,7 +2147,8 @@ declare_local_label (tree id)
 static int
 decl_jump_unsafe (tree decl)
 {
-  if (TREE_CODE (decl) != VAR_DECL || TREE_STATIC (decl))
+  if (TREE_CODE (decl) != VAR_DECL || TREE_STATIC (decl)
+      || TREE_TYPE (decl) == error_mark_node)
     return 0;
 
   if (TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl))
index 3be28a7..82124c6 100644 (file)
@@ -1,3 +1,8 @@
+2005-11-03  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR c++/24582
+       * g++.dg/init/switch1.C: New test.
+
 2005-11-03  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        * gcc.dg/delay-slot-1.c: New test.
diff --git a/gcc/testsuite/g++.dg/init/switch1.C b/gcc/testsuite/g++.dg/init/switch1.C
new file mode 100644 (file)
index 0000000..b0b06b7
--- /dev/null
@@ -0,0 +1,8 @@
+int f(int c)
+{
+  switch (c)
+  {
+    case d: /* { dg-error "'d' was not declared" } */
+     int optBzip2 = true;
+  }
+}