diff --git a/cpplint.py b/cpplint.py index a01ffa2bf3..087b0e849c 100755 --- a/cpplint.py +++ b/cpplint.py @@ -4106,10 +4106,12 @@ def CheckBraces(filename, clean_lines, linenum, error): endpos) = CloseExpression(clean_lines, linenum, pos) # Check for an opening brace, either directly after the if or on the # next line. If found, this isn't a single-statement conditional. - if (not Match(r'\s*{', endline[endpos:]) - and not (Match(r'\s*$', endline[endpos:]) and endlinenum < - (len(clean_lines.elided) - 1) and Match( - r'\s*{', clean_lines.elided[endlinenum + 1]))): + if (not Match(r'\s*(?:\[\[(?:un)?likely\]\]\s*)?{', endline[endpos:]) + and not (Match(r'\s*(?:\[\[(?:un)?likely\]\]\s*)?$', + endline[endpos:]) + and endlinenum < (len(clean_lines.elided) - 1) + and Match(r'\s*(?:\[\[(?:un)?likely\]\]\s*)?{', + clean_lines.elided[endlinenum + 1]))): while (endlinenum < len(clean_lines.elided) and ';' not in clean_lines.elided[endlinenum][endpos:]): endlinenum += 1