[PATCH] D52695: [clang][Parse] Diagnose useless null statements (PR39111)

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 2 13:48:03 PDT 2018


lebedev.ri added inline comments.


================
Comment at: include/clang/Basic/DiagnosticGroups.td:167-168
+                                         CXX11ExtraSemi,
+                                         ExtraSemiStmt,
+                                         EmptyInitStatement]>;
 
----------------
rsmith wrote:
> I would prefer to keep `-Wextra-semi` and `-Wextra-semi-stmt` separate. `-Wextra-semi` is for those cases that are ill-formed in C++98, whereas your new warning is only about code style / typo detection.
Hmm, does that mean ExtraSemiStmt[+EmptyInitStatement] should be in `-Wextra`?


================
Comment at: lib/Parse/ParseStmt.cpp:1600
 
+  llvm::Optional<SourceLocation> EmptyInitStmtSemiLoc;
+
----------------
rsmith wrote:
> You can just use a `SourceLocation` here; it already has an 'invalid' state.
Aha.


Repository:
  rC Clang

https://reviews.llvm.org/D52695





More information about the cfe-commits mailing list