diff --git a/clang/lib/Tooling/Refactoring/Extract/SourceExtraction.cpp b/clang/lib/Tooling/Refactoring/Extract/SourceExtraction.cpp --- a/clang/lib/Tooling/Refactoring/Extract/SourceExtraction.cpp +++ b/clang/lib/Tooling/Refactoring/Extract/SourceExtraction.cpp @@ -36,12 +36,17 @@ return isSemicolonRequiredAfter(While->getBody()); if (const auto *For = dyn_cast(S)) return isSemicolonRequiredAfter(For->getBody()); + if (const auto *Do = dyn_cast(S)) + return isSemicolonRequiredAfter(Do->getBody()); if (const auto *CXXFor = dyn_cast(S)) return isSemicolonRequiredAfter(CXXFor->getBody()); if (const auto *ObjCFor = dyn_cast(S)) return isSemicolonRequiredAfter(ObjCFor->getBody()); + if(const auto *Switch = dyn_cast(S)) + return isSemicolonRequiredAfter(Switch->getBody()); + if(const auto *Case = dyn_cast(S)) + return isSemicolonRequiredAfter(Case->getSubStmt()); switch (S->getStmtClass()) { - case Stmt::SwitchStmtClass: case Stmt::CXXTryStmtClass: case Stmt::ObjCAtSynchronizedStmtClass: case Stmt::ObjCAutoreleasePoolStmtClass: