if(const auto *Case = dyn_cast<SwitchCase>(S))
return isSemicolonRequiredAfter(Case->getSubStmt());
switch (S->getStmtClass()) {
+ case Stmt::DeclStmtClass:
case Stmt::CXXTryStmtClass:
case Stmt::ObjCAtSynchronizedStmtClass:
case Stmt::ObjCAutoreleasePoolStmtClass:
// CHECK-NEXT: }
void careForSwitchSemicolon() {
- /*range mextract=->+0:51*/switch(0) default: break;
+ /*range mextract=->+0:53*/switch(0) default: break;
}
// CHECK: 1 'mextract' results:
// CHECK: static void extracted() {
// CHECK-NEXT: extracted();{{$}}
// CHECK-NEXT: }
+void extractStatementNotSemiDecl() {
+ /*range nextract=->+0:38*/int x = 5;
+}
+// CHECK: 1 'nextract' results:
+// CHECK: static void extracted() {
+// CHECK-NEXT: int x = 5;{{$}}
+// CHECK-NEXT: }{{[[:space:]].*}}
+// CHECK-NEXT: void extractStatementNotSemiDecl() {
+// CHECK-NEXT: extracted();{{$}}
+// CHECK-NEXT: }
+