Skip to content

Commit eab6eb6

Browse files
committed
Remove init-statement in selection statements
1 parent c8af900 commit eab6eb6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/Interpreter/CXCppInterOp.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,8 @@ bool clang_scope_isComplete(CXScope S) {
378378
const auto* CI = getInterpreter(S)->getCI();
379379
auto& Sema = CI->getSema();
380380
const auto& SM = Sema.getSourceManager();
381-
const clang::SourceLocation fakeLoc = SM.getLocForStartOfFile(SM.getMainFileID());
381+
const clang::SourceLocation fakeLoc =
382+
SM.getLocForStartOfFile(SM.getMainFileID());
382383
return Sema.isCompleteType(fakeLoc, QT);
383384
}
384385

@@ -603,8 +604,8 @@ CXScope clang_scope_getScope(const char* name, CXScope parent) {
603604
if (kind(S) == CXScope_Invalid)
604605
return S;
605606

606-
if (auto* ND = llvm::dyn_cast<clang::NamedDecl>(getDecl(S));
607-
llvm::isa<clang::NamespaceDecl>(ND) || llvm::isa<clang::RecordDecl>(ND) ||
607+
auto* ND = llvm::dyn_cast<clang::NamedDecl>(getDecl(S));
608+
if (llvm::isa<clang::NamespaceDecl>(ND) || llvm::isa<clang::RecordDecl>(ND) ||
608609
llvm::isa<clang::ClassTemplateDecl>(ND) ||
609610
llvm::isa<clang::TypedefNameDecl>(ND)) {
610611
return makeCXScope(getMeta(S), ND->getCanonicalDecl());
@@ -616,15 +617,14 @@ CXScope clang_scope_getScope(const char* name, CXScope parent) {
616617
CXScope clang_scope_getNamed(const char* name, CXScope parent) {
617618
const clang::DeclContext* Within = nullptr;
618619
if (kind(parent) != CXScope_Invalid) {
619-
if (const auto US = clang_scope_getUnderlyingScope(parent);
620-
kind(US) != CXScope_Invalid)
620+
const auto US = clang_scope_getUnderlyingScope(parent);
621+
if (kind(US) != CXScope_Invalid)
621622
Within = llvm::dyn_cast<clang::DeclContext>(getDecl(US));
622623
}
623624

624625
auto& sema = getInterpreter(parent)->getSema();
625-
if (auto* ND =
626-
Cpp::Cpp_utils::Lookup::Named(&sema, std::string(name), Within);
627-
ND && intptr_t(ND) != (intptr_t)-1) {
626+
auto* ND = Cpp::Cpp_utils::Lookup::Named(&sema, std::string(name), Within);
627+
if (ND && intptr_t(ND) != (intptr_t)-1) {
628628
return makeCXScope(getMeta(parent), ND->getCanonicalDecl());
629629
}
630630

0 commit comments

Comments
 (0)