From: Thomas Rast Date: Tue, 20 Dec 2011 09:13:51 GMT Subject: Re: [PATCH v2] t4018: introduce test cases for the internal hunk header patterns Message-ID: <87ty4vli5s.fsf@thomas.inf.ethz.ch> In-Reply-To: <1324348939-27115-1-git-send-email-drafnel@gmail.com> Brandon Casey writes: > Let's introduce some infrastructure to make it easy to create test cases > for the hunk header patterns and provide a few cases for the cpp pattern. [...] > int WRONG_function_hunk_header (void) [...] > int RIGHT_function_hunk_header (void) > { > const char *msg = "ChangeMe"; Excellent idea! > +template int RIGHT_function_hunk_header (T unused) > +{ > + const char *msg = "ChangeMe"; > + printf("Hello, world, %s\n", msg); > + return 0; > +} I'd still like to have an extremely contrived overuse of templated classes, like so: ---- 8< ---- int WRONG_function_hunk_header_preceding_the_right_one (void) { return 0; } foo::RIGHT::operator<<(int bar) { const char *msg = "ChangeMe"; printf("Hello, world, %s\n", msg); return 0; } int WRONG_function_hunk_header_following_the_right_one (void) { return 0; } ---- >8 ---- That will guard us against updating the C++ pattern to something better but still slightly too simple. Other than that and Jakub's comments, Acked-by: Thomas Rast -- Thomas Rast trast@{inf,student}.ethz.ch