It also caused a code analysis tool to wander off into the weeds.

2011-06-05  Bruce Korb  <bk...@gnu.org>

        * gcc/cp/cxx-pretty-print.c (pp_cxx_decl_specifier_seq): Do not have a 
switch
        label pointing into an "else" clause for an "if".

Index: gcc/cp/cxx-pretty-print.c
===================================================================
--- gcc/cp/cxx-pretty-print.c   (revision 174678)
+++ gcc/cp/cxx-pretty-print.c   (working copy)
@@ -1199,13 +1199,16 @@

     case FUNCTION_DECL:
       /* Constructors don't have return types.  And conversion functions
-        do not have a type-specifier in their return types.  */
+         do not have a type-specifier in their return types.  */
+
       if (DECL_CONSTRUCTOR_P (t) || DECL_CONV_FN_P (t))
-       pp_cxx_function_specifier (pp, t);
-      else if (DECL_NONSTATIC_MEMBER_FUNCTION_P (t))
-       pp_cxx_decl_specifier_seq (pp, TREE_TYPE (TREE_TYPE (t)));
-      else
-       default:
+        pp_cxx_function_specifier (pp, t), break;
+
+      if (DECL_NONSTATIC_MEMBER_FUNCTION_P (t))
+        pp_cxx_decl_specifier_seq (pp, TREE_TYPE (TREE_TYPE (t))), break;
+      /* FALLTHROUGH */
+
+    default:
       pp_c_declaration_specifiers (pp_c_base (pp), t);
       break;
     }

Reply via email to