Message ID | 4DEC38CC.1080006@gmail.com |
---|---|
State | New |
Headers | show |
On Sun, 05 Jun 2011 19:17:48 -0700 Bruce Korb <bruce.korb@gmail.com> wrote: > It also caused a code analysis tool to wander off into the weeds. > + if (DECL_NONSTATIC_MEMBER_FUNCTION_P (t)) > + pp_cxx_decl_specifier_seq (pp, TREE_TYPE (TREE_TYPE (t))), break; > + /* FALLTHROUGH */ I believe the usual GCC style is using braces, e.g if (DECL_NONSTATIC_MEMBER_FUNCTION_P (t)) { pp_cxx_decl_specifier_seq (pp, TREE_TYPE (TREE_TYPE (t))); break; } /* FALLTHROUGH */
On 06/06/2011 04:17 AM, Bruce Korb wrote:
> It also caused a code analysis tool to wander off into the weeds.
And "x, break;" didn't? :)
(First time I see it, I swear).
Paolo
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; }