Patch: aesthetics for gcc/cp/cxx-pretty-print.c
Bruce Korb
bruce.korb@gmail.com
Mon Jun 6 02:18:00 GMT 2011
It also caused a code analysis tool to wander off into the weeds.
2011-06-05 Bruce Korb <bkorb@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;
}
More information about the Gcc-patches
mailing list