Lines Matching +full:semi +full:- +full:static
1 //===--- ParseCXXInlineMethods.cpp - C++ class inline methods parsing------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
23 /// Parse the optional ("message") part of a deleted-function-body.
35 Diag(Message->getBeginLoc(), getLangOpts().CPlusPlus26 in ParseCXXDeletedFunctionMessage()
38 << Message->getSourceRange(); in ParseCXXDeletedFunctionMessage()
50 /// If we've encountered '= delete' in a context where it is ill-formed, such
51 /// as in the declaration of a non-function, also skip the ("message") part if
66 /// ParseCXXInlineMethodDef - We parsed and verified that the specified
78 TemplateInfo.TemplateParams ? TemplateInfo.TemplateParams->data() in ParseCXXInlineMethodDef()
80 TemplateInfo.TemplateParams ? TemplateInfo.TemplateParams->size() : 0); in ParseCXXInlineMethodDef()
104 SkipUntil(tok::semi); in ParseCXXInlineMethodDef()
110 SourceLocation KWEndLoc = Tok.getEndLoc().getLocWithOffset(-1); in ParseCXXInlineMethodDef()
120 DeclAsFunction->setRangeEnd(KWEndLoc); in ParseCXXInlineMethodDef()
129 DeclAsFunction->setRangeEnd(KWEndLoc); in ParseCXXInlineMethodDef()
138 SkipUntil(tok::semi); in ParseCXXInlineMethodDef()
139 } else if (ExpectAndConsume(tok::semi, diag::err_expected_after, in ParseCXXInlineMethodDef()
141 SkipUntil(tok::semi); in ParseCXXInlineMethodDef()
159 !(FnD && FnD->getAsFunction() && in ParseCXXInlineMethodDef()
160 FnD->getAsFunction()->getReturnType()->getContainedAutoType()) && in ParseCXXInlineMethodDef()
161 ((Actions.CurContext->isDependentContext() || in ParseCXXInlineMethodDef()
170 FunctionDecl *FD = FnD->getAsFunction(); in ParseCXXInlineMethodDef()
182 CachedTokens &Toks = LM->Toks; in ParseCXXInlineMethodDef()
188 // We didn't find the left-brace we expected after the in ParseCXXInlineMethodDef()
191 // If we're code-completing and the completion point was in the broken in ParseCXXInlineMethodDef()
216 // If we're in a function-try-block, we need to store all the catch blocks. in ParseCXXInlineMethodDef()
225 FunctionDecl *FD = FnD->getAsFunction(); in ParseCXXInlineMethodDef()
229 FD->setWillHaveBody(true); in ParseCXXInlineMethodDef()
232 // just throw away the late-parsed declaration. in ParseCXXInlineMethodDef()
240 /// ParseCXXNonStaticMemberInitializer - We parsed and verified that the
241 /// specified Declarator is a well formed C++ non-static data member
251 CachedTokens &Toks = MI->Toks; in ParseCXXNonStaticMemberInitializer()
292 Self->DeallocateParsedClasses(Class); in ~LateParsedClass()
296 Self->ParseLexedMethodDeclarations(*Class); in ParseLexedMethodDeclarations()
300 Self->ParseLexedMemberInitializers(*Class); in ParseLexedMemberInitializers()
304 Self->ParseLexedMethodDefs(*Class); in ParseLexedMethodDefs()
308 Self->ParseLexedAttributes(*Class); in ParseLexedAttributes()
312 Self->ParseLexedPragmas(*Class); in ParseLexedPragmas()
316 Self->ParseLexedMethodDeclaration(*this); in ParseLexedMethodDeclarations()
320 Self->ParseLexedMethodDef(*this); in ParseLexedMethodDefs()
324 Self->ParseLexedMemberInitializer(*this); in ParseLexedMemberInitializers()
328 Self->ParseLexedAttribute(*this, true, false); in ParseLexedAttributes()
332 Self->ParseLexedPragma(*this); in ParseLexedPragmas()
335 /// Utility to re-enter a possibly-templated scope while parsing its
336 /// late-parsed components.
351 /// Utility to re-enter a class scope while parsing its late-parsed components.
359 // If this is the top-level class, we're still within its scope. in ReenterClassScopeRAII()
363 // Re-enter the class scope itself. in ReenterClassScopeRAII()
377 /// ParseLexedMethodDeclarations - We finished parsing the member
378 /// specification of a top (non-nested) C++ class. Now go over the
385 LateD->ParseLexedMethodDeclarations(); in ParseLexedMethodDeclarations()
403 bool HasUnparsed = Param->hasUnparsedDefaultArg(); in ParseLexedMethodDeclaration()
411 Token LastDefaultArgToken = Toks->back(); in ParseLexedMethodDeclaration()
417 Toks->push_back(DefArgEnd); in ParseLexedMethodDeclaration()
420 Toks->push_back(Tok); // So that the current token doesn't get lost in ParseLexedMethodDeclaration()
423 // Consume the previously-pushed token. in ParseLexedMethodDeclaration()
451 assert(Toks->size() >= 3 && "expected a token in default arg"); in ParseLexedMethodDeclaration()
454 (*Toks)[Toks->size() - 3].getLocation()); in ParseLexedMethodDeclaration()
468 assert(Param->hasInheritedDefaultArg()); in ParseLexedMethodDeclaration()
472 cast<FunctionDecl>(FunTmpl->getTemplatedDecl())->getPreviousDecl(); in ParseLexedMethodDeclaration()
474 Old = cast<FunctionDecl>(LM.Method)->getPreviousDecl(); in ParseLexedMethodDeclaration()
476 ParmVarDecl *OldParam = Old->getParamDecl(I); in ParseLexedMethodDeclaration()
477 assert(!OldParam->hasUnparsedDefaultArg()); in ParseLexedMethodDeclaration()
478 if (OldParam->hasUninstantiatedDefaultArg()) in ParseLexedMethodDeclaration()
479 Param->setUninstantiatedDefaultArg( in ParseLexedMethodDeclaration()
480 OldParam->getUninstantiatedDefaultArg()); in ParseLexedMethodDeclaration()
482 Param->setDefaultArg(OldParam->getInit()); in ParseLexedMethodDeclaration()
487 // Parse a delayed exception-specification, if there is one. in ParseLexedMethodDeclaration()
492 Token LastExceptionSpecToken = Toks->back(); in ParseLexedMethodDeclaration()
498 Toks->push_back(ExceptionSpecEnd); in ParseLexedMethodDeclaration()
501 Toks->push_back(Tok); // So that the current token doesn't get lost in ParseLexedMethodDeclaration()
504 // Consume the previously-pushed token. in ParseLexedMethodDeclaration()
510 // "pointer to cv-qualifier-seq X" between the optional cv-qualifer-seq in ParseLexedMethodDeclaration()
511 // and the end of the function-definition, member-declarator, or in ParseLexedMethodDeclaration()
517 FunctionToPush = FunTmpl->getTemplatedDecl(); in ParseLexedMethodDeclaration()
529 // Setup the CurScope to match the function DeclContext - we have such in ParseLexedMethodDeclaration()
538 Actions, Method ? Method->getParent() : nullptr, in ParseLexedMethodDeclaration()
539 Method ? Method->getMethodQualifiers() : Qualifiers{}, in ParseLexedMethodDeclaration()
542 // Parse the exception-specification. in ParseLexedMethodDeclaration()
558 // Attach the exception-specification to the method. in ParseLexedMethodDeclaration()
585 /// ParseLexedMethodDefs - We finished parsing the member specification of a top
586 /// (non-nested) C++ class. Now go over the stack of lexed methods that were
592 D->ParseLexedMethodDefs(); in ParseLexedMethodDefs()
620 // to be re-used for method bodies as well. in ParseLexedMethodDef()
657 cast<FunctionTemplateDecl>(LM.D)->getTemplateParameters()->getDepth() in ParseLexedMethodDef()
672 FD->isInIdentifierNamespace(Decl::IDNS_OrdinaryFriend)) in ParseLexedMethodDef()
676 /// ParseLexedMemberInitializers - We finished parsing the member specification
677 /// of a top (non-nested) C++ class. Now go over the stack of lexed data member
684 // Otherwise, if a member-declarator declares a non-static data member in ParseLexedMemberInitializers()
686 // to X" within the optional brace-or-equal-initializer. It shall not in ParseLexedMemberInitializers()
687 // appear elsewhere in the member-declarator. in ParseLexedMemberInitializers()
693 D->ParseLexedMemberInitializers(); in ParseLexedMemberInitializers()
700 if (!MI.Field || MI.Field->isInvalidDecl()) in ParseLexedMemberInitializer()
753 LateD->ParseLexedAttributes(); in ParseLexedAttributes()
763 LAs[i]->addDecl(D); in ParseLexedAttributeList()
798 RecordDecl *RD = dyn_cast_or_null<RecordDecl>(D->getDeclContext()); in ParseLexedAttribute()
800 // Allow 'this' within late-parsed attributes. in ParseLexedAttribute()
802 ND && ND->isCXXInstanceMember()); in ParseLexedAttribute()
809 bool HasFunScope = EnterScope && D->isFunctionOrFunctionTemplate(); in ParseLexedAttribute()
833 if (OnDefinition && !Attrs.empty() && !Attrs.begin()->isCXX11Attribute() && in ParseLexedAttribute()
834 Attrs.begin()->isKnownToGCC()) in ParseLexedAttribute()
854 D->ParseLexedPragmas(); in ParseLexedPragmas()
878 /// ConsumeAndStoreUntil - Consume and store the token at the passed token
910 // Recursively consume properly-nested parens. in ConsumeAndStoreUntil()
916 // Recursively consume properly-nested square brackets. in ConsumeAndStoreUntil()
922 // Recursively consume properly-nested braces. in ConsumeAndStoreUntil()
952 case tok::semi: in ConsumeAndStoreUntil()
998 // We can't reliably skip over a mem-initializer-id, because it could be in ConsumeAndStoreFunctionPrologue()
999 // a template-id involving not-yet-declared names. Given: in ConsumeAndStoreFunctionPrologue()
1011 // Skip over the mem-initializer-id, if possible. in ConsumeAndStoreFunctionPrologue()
1027 // Walk over a component of a nested-name-specifier. in ConsumeAndStoreFunctionPrologue()
1080 // next parenthesized initializer or braced-init-list. This *might* be the in ConsumeAndStoreFunctionPrologue()
1093 // We found something weird in a mem-initializer-id. in ConsumeAndStoreFunctionPrologue()
1116 const Token &PreviousToken = Toks[Toks.size() - 2]; in ConsumeAndStoreFunctionPrologue()
1121 // missing the mem-initializer-id. In order to recover better, we need in ConsumeAndStoreFunctionPrologue()
1123 // beginning of a brace-init-list or the function body. in ConsumeAndStoreFunctionPrologue()
1139 // if we might be inside the braces of a lambda-expression. in ConsumeAndStoreFunctionPrologue()
1153 // If we know we just consumed a mem-initializer, we must have ',' or '{' in ConsumeAndStoreFunctionPrologue()
1172 // going to be made ill-formed by core issue 1607. in ConsumeAndStoreFunctionPrologue()
1229 Buffer[Toks.size() - 1] = Self.Tok; in RevertAnnotations()
1243 /// ConsumeAndStoreInitializer - Consume and store the token at the passed token
1245 /// default argument or an in-class initializer for a non-static data member).
1247 /// Returns \c true if we reached the end of something initializer-shaped,
1273 // syntactically-valid parameter-declaration-clause, in which each in ConsumeAndStoreInitializer()
1277 // syntactically-valid init-declarator-list, then this comma ends in ConsumeAndStoreInitializer()
1282 ? tok::semi : tok::r_paren); in ConsumeAndStoreInitializer()
1290 // If we parsed a complete, ambiguous init-declarator-list, this in ConsumeAndStoreInitializer()
1291 // is only syntactically-valid if it's followed by a semicolon. in ConsumeAndStoreInitializer()
1292 if (Result == TPResult::Ambiguous && Tok.isNot(tok::semi)) in ConsumeAndStoreInitializer()
1330 // FIXME: A '<' can only start a template-id if it's preceded by an in ConsumeAndStoreInitializer()
1331 // identifier, an operator-function-id, or a literal-operator-id. in ConsumeAndStoreInitializer()
1345 if (AngleCount) --AngleCount; in ConsumeAndStoreInitializer()
1346 if (KnownTemplateCount) --KnownTemplateCount; in ConsumeAndStoreInitializer()
1351 if (AngleCount) --AngleCount; in ConsumeAndStoreInitializer()
1352 if (KnownTemplateCount) --KnownTemplateCount; in ConsumeAndStoreInitializer()
1355 if (AngleCount) --AngleCount; in ConsumeAndStoreInitializer()
1356 if (KnownTemplateCount) --KnownTemplateCount; in ConsumeAndStoreInitializer()
1362 // FIXME: Support all forms of 'template' unqualified-id '<'. in ConsumeAndStoreInitializer()
1397 // Recursively consume properly-nested parens. in ConsumeAndStoreInitializer()
1403 // Recursively consume properly-nested square brackets. in ConsumeAndStoreInitializer()
1409 // Recursively consume properly-nested braces. in ConsumeAndStoreInitializer()
1455 case tok::semi: in ConsumeAndStoreInitializer()