From b591447f772ed5411e207854b2125bff08902bf7 Mon Sep 17 00:00:00 2001 From: Nicolas Hillegeer Date: Sun, 18 May 2014 11:21:32 +0200 Subject: [PATCH] clint: disregard compound literal return This allows lines like: return (my_struct_type) { .my_int = 5, .my_str = "" }; Thanks to @watk for finding and fixing it! --- clint.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clint.py b/clint.py index 01d179a3f7..13d2d8cbe9 100755 --- a/clint.py +++ b/clint.py @@ -2307,7 +2307,8 @@ def CheckBraces(filename, clean_lines, linenum, error): 'TEST', 'TEST_F', 'MATCHER', 'MATCHER_P', 'TYPED_TEST', 'EXCLUSIVE_LOCKS_REQUIRED', 'SHARED_LOCKS_REQUIRED', 'LOCKS_EXCLUDED', 'INTERFACE_DEF')) or - Search(r'\s+=\s*$', line_prefix)): + Search(r'\s+=\s*$', line_prefix) or + Search(r'^\s*return\s*$', line_prefix)): match = None else: