clang: Tweak behaviour of warn_empty_while_body and warn_empty_if_body
Use the if/while statement right paren location instead of the end of the condition expression to determine if the semicolon is on its own line, for the purpose of not warning about code like this: while (foo()) ; Using the condition location meant that we would also not report a warning on code like this: while (MACRO(a, b)); body(); The right paren loc wasn't stored in the AST or passed into Sema::ActOnIfStmt when this logic was first written. Reviewed By: rnk, gribozavr2 Differential Revision: https://reviews.llvm.org/D128406
Loading
Please sign in to comment