hokein added inline comments.

================
Comment at: clang-tidy/misc/SuspiciousSemicolonCheck.cpp:23
@@ +22,3 @@
+  Finder->addMatcher(
+      stmt(anyOf(ifStmt(hasThen(nullStmt().bind("semi"))),
+                 forStmt(hasBody(nullStmt().bind("semi"))),
----------------
Looks like this check doesn't handle the case that  unintended semicolon is in 
`else` statement.

```
if (condition1) {
} else if (condition2);
  a = 2
```

================
Comment at: test/clang-tidy/misc-suspicious-semicolon.cpp:28
@@ +27,3 @@
+{
+  if(x > 5); nop();
+  // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: potentially unintended 
semicolon [misc-suspicious-semicolon]
----------------
Can you add the following `if` statement cases in the test?

```
if (condition)
  ;
```

```
if (condition)
  ;
else {
}
```

The behavior of the check is that both two cases are not warned. But I think we 
should warn the first one since there is no reason to write `if` code for that.


http://reviews.llvm.org/D16535



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to