furkanusta created this revision. Herald added subscribers: usaxena95, kadircet. Herald added a project: All. furkanusta requested review of this revision. Herald added subscribers: cfe-commits, ilya-biryukov. Herald added a project: clang.
Fixes: https://github.com/clangd/clangd/issues/290 Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D130363 Files: clang/lib/Parse/ParseDecl.cpp Index: clang/lib/Parse/ParseDecl.cpp =================================================================== --- clang/lib/Parse/ParseDecl.cpp +++ clang/lib/Parse/ParseDecl.cpp @@ -3266,13 +3266,13 @@ return; } - if (getCurScope()->getFnParent() || getCurScope()->getBlockParent()) - CCC = Sema::PCC_LocalDeclarationSpecifiers; - else if (TemplateInfo.Kind != ParsedTemplateInfo::NonTemplate) + if (TemplateInfo.Kind != ParsedTemplateInfo::NonTemplate) CCC = DSContext == DeclSpecContext::DSC_class ? Sema::PCC_MemberTemplate : Sema::PCC_Template; else if (DSContext == DeclSpecContext::DSC_class) CCC = Sema::PCC_Class; + else if (getCurScope()->getFnParent() || getCurScope()->getBlockParent()) + CCC = Sema::PCC_LocalDeclarationSpecifiers; else if (CurParsedObjCImpl) CCC = Sema::PCC_ObjCImplementation;
Index: clang/lib/Parse/ParseDecl.cpp =================================================================== --- clang/lib/Parse/ParseDecl.cpp +++ clang/lib/Parse/ParseDecl.cpp @@ -3266,13 +3266,13 @@ return; } - if (getCurScope()->getFnParent() || getCurScope()->getBlockParent()) - CCC = Sema::PCC_LocalDeclarationSpecifiers; - else if (TemplateInfo.Kind != ParsedTemplateInfo::NonTemplate) + if (TemplateInfo.Kind != ParsedTemplateInfo::NonTemplate) CCC = DSContext == DeclSpecContext::DSC_class ? Sema::PCC_MemberTemplate : Sema::PCC_Template; else if (DSContext == DeclSpecContext::DSC_class) CCC = Sema::PCC_Class; + else if (getCurScope()->getFnParent() || getCurScope()->getBlockParent()) + CCC = Sema::PCC_LocalDeclarationSpecifiers; else if (CurParsedObjCImpl) CCC = Sema::PCC_ObjCImplementation;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits