20 using namespace clang;
25 NamedDecl *Parser::ParseCXXInlineMethodDef(
30 assert(Tok.
isOneOf(tok::l_brace, tok::colon, tok::kw_try, tok::equal) &&
31 "Current token not a '{', ':', '=', or 'try'!");
34 TemplateInfo.TemplateParams ? TemplateInfo.TemplateParams->data()
36 TemplateInfo.TemplateParams ? TemplateInfo.TemplateParams->size() : 0);
44 TemplateParams,
nullptr,
54 HandleMemberFunctionDeclDelays(D, FnD);
69 ? diag::warn_cxx98_compat_defaulted_deleted_function
70 : diag::ext_defaulted_deleted_function)
74 if (
auto *DeclAsFunction = dyn_cast<FunctionDecl>(FnD)) {
75 DeclAsFunction->setRangeEnd(KWEndLoc);
79 ? diag::warn_cxx98_compat_defaulted_deleted_function
80 : diag::ext_defaulted_deleted_function)
83 if (
auto *DeclAsFunction = dyn_cast<FunctionDecl>(FnD)) {
84 DeclAsFunction->setRangeEnd(KWEndLoc);
87 llvm_unreachable(
"function definition after = not 'delete' or 'default'");
90 if (Tok.
is(tok::comma)) {
91 Diag(KWLoc, diag::err_default_delete_in_multiple_declaration)
94 }
else if (ExpectAndConsume(tok::semi, diag::err_expected_after,
95 Delete ?
"delete" :
"default")) {
103 trySkippingFunctionBody()) {
114 !(FnD && FnD->getAsFunction() &&
115 FnD->getAsFunction()->getReturnType()->getContainedAutoType()) &&
117 (TemplateInfo.Kind != ParsedTemplateInfo::NonTemplate &&
118 TemplateInfo.Kind != ParsedTemplateInfo::ExplicitSpecialization)) &&
122 LexTemplateFunctionForLateParsing(Toks);
135 LexedMethod* LM =
new LexedMethod(
this, FnD);
136 getCurrentClass().LateParsedDeclarations.push_back(LM);
143 if (ConsumeAndStoreFunctionPrologue(Toks)) {
150 delete getCurrentClass().LateParsedDeclarations.back();
151 getCurrentClass().LateParsedDeclarations.pop_back();
155 ConsumeAndStoreUntil(tok::r_brace, Toks,
false);
159 if (kind == tok::kw_try) {
160 while (Tok.
is(tok::kw_catch)) {
161 ConsumeAndStoreUntil(tok::l_brace, Toks,
false);
162 ConsumeAndStoreUntil(tok::r_brace, Toks,
false);
175 delete getCurrentClass().LateParsedDeclarations.back();
176 getCurrentClass().LateParsedDeclarations.pop_back();
186 void Parser::ParseCXXNonStaticMemberInitializer(
Decl *VarD) {
187 assert(Tok.
isOneOf(tok::l_brace, tok::equal) &&
188 "Current token not a '{' or '='!");
190 LateParsedMemberInitializer *MI =
191 new LateParsedMemberInitializer(
this, VarD);
192 getCurrentClass().LateParsedDeclarations.push_back(MI);
196 if (kind == tok::equal) {
201 if (kind == tok::l_brace) {
207 ConsumeAndStoreUntil(tok::r_brace, Toks,
true);
210 ConsumeAndStoreInitializer(Toks, CIK_DefaultInitializer);
223 Parser::LateParsedDeclaration::~LateParsedDeclaration() {}
224 void Parser::LateParsedDeclaration::ParseLexedMethodDeclarations() {}
225 void Parser::LateParsedDeclaration::ParseLexedMemberInitializers() {}
226 void Parser::LateParsedDeclaration::ParseLexedMethodDefs() {}
228 Parser::LateParsedClass::LateParsedClass(
Parser *
P, ParsingClass *
C)
229 : Self(P),
Class(C) {}
231 Parser::LateParsedClass::~LateParsedClass() {
232 Self->DeallocateParsedClasses(Class);
235 void Parser::LateParsedClass::ParseLexedMethodDeclarations() {
236 Self->ParseLexedMethodDeclarations(*Class);
239 void Parser::LateParsedClass::ParseLexedMemberInitializers() {
240 Self->ParseLexedMemberInitializers(*Class);
243 void Parser::LateParsedClass::ParseLexedMethodDefs() {
244 Self->ParseLexedMethodDefs(*Class);
247 void Parser::LateParsedMethodDeclaration::ParseLexedMethodDeclarations() {
248 Self->ParseLexedMethodDeclaration(*
this);
251 void Parser::LexedMethod::ParseLexedMethodDefs() {
252 Self->ParseLexedMethodDef(*
this);
255 void Parser::LateParsedMemberInitializer::ParseLexedMemberInitializers() {
256 Self->ParseLexedMemberInitializer(*
this);
263 void Parser::ParseLexedMethodDeclarations(ParsingClass &Class) {
264 bool HasTemplateScope = !Class.TopLevelClass && Class.TemplateScope;
267 TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);
268 if (HasTemplateScope) {
270 ++CurTemplateDepthTracker;
275 bool HasClassScope = !Class.TopLevelClass;
280 Class.TagOrTemplate);
282 for (
size_t i = 0; i < Class.LateParsedDeclarations.size(); ++i) {
283 Class.LateParsedDeclarations[i]->ParseLexedMethodDeclarations();
288 Class.TagOrTemplate);
291 void Parser::ParseLexedMethodDeclaration(LateParsedMethodDeclaration &LM) {
294 TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);
295 if (LM.TemplateScope) {
297 ++CurTemplateDepthTracker;
306 for (
unsigned I = 0, N = LM.DefaultArgs.size(); I != N; ++I) {
307 auto Param = cast<ParmVarDecl>(LM.DefaultArgs[I].Param);
309 bool HasUnparsed = Param->hasUnparsedDefaultArg();
311 std::unique_ptr<CachedTokens> Toks = std::move(LM.DefaultArgs[I].Toks);
317 Token LastDefaultArgToken = Toks->back();
323 Toks->push_back(DefArgEnd);
326 Toks->push_back(Tok);
327 PP.EnterTokenStream(*Toks,
true);
333 assert(Tok.
is(tok::equal) &&
"Default argument not starting with '='");
344 Diag(Tok, diag::warn_cxx98_compat_generalized_initializer_lists);
345 DefArgResult = ParseBraceInitializer();
356 assert(Toks->size() >= 3 &&
"expected a token in default arg");
359 (*Toks)[Toks->size() - 3].getLocation());
372 }
else if (HasUnparsed) {
373 assert(Param->hasInheritedDefaultArg());
374 FunctionDecl *Old = cast<FunctionDecl>(LM.Method)->getPreviousDecl();
381 Param->setDefaultArg(OldParam->
getInit());
390 Token LastExceptionSpecToken = Toks->back();
391 Token ExceptionSpecEnd;
396 Toks->push_back(ExceptionSpecEnd);
399 Toks->push_back(Tok);
400 PP.EnterTokenStream(*Toks,
true);
413 = dyn_cast<FunctionTemplateDecl>(LM.Method))
414 Method = cast<CXXMethodDecl>(FunTmpl->getTemplatedDecl());
416 Method = cast<CXXMethodDecl>(LM.Method);
419 Method->getTypeQualifiers(),
430 = tryParseExceptionSpecification(
false, SpecificationRange,
432 DynamicExceptionRanges, NoexceptExpr,
433 ExceptionSpecTokens);
442 DynamicExceptionRanges,
444 NoexceptExpr.
get() :
nullptr);
456 LM.ExceptionSpecTokens =
nullptr;
459 PrototypeScope.Exit();
468 void Parser::ParseLexedMethodDefs(ParsingClass &Class) {
469 bool HasTemplateScope = !Class.TopLevelClass && Class.TemplateScope;
471 TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);
472 if (HasTemplateScope) {
474 ++CurTemplateDepthTracker;
476 bool HasClassScope = !Class.TopLevelClass;
480 for (
size_t i = 0; i < Class.LateParsedDeclarations.size(); ++i) {
481 Class.LateParsedDeclarations[i]->ParseLexedMethodDefs();
485 void Parser::ParseLexedMethodDef(LexedMethod &LM) {
488 TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);
489 if (LM.TemplateScope) {
491 ++CurTemplateDepthTracker;
496 assert(!LM.Toks.empty() &&
"Empty body!");
497 Token LastBodyToken = LM.Toks.back();
503 LM.Toks.push_back(BodyEnd);
506 LM.Toks.push_back(Tok);
507 PP.EnterTokenStream(LM.Toks,
true);
511 assert(Tok.
isOneOf(tok::l_brace, tok::colon, tok::kw_try)
512 &&
"Inline method not starting with '{', ':' or 'try'");
520 if (Tok.
is(tok::kw_try)) {
521 ParseFunctionTryBlock(LM.D, FnScope);
530 if (Tok.
is(tok::colon)) {
531 ParseConstructorInitializer(LM.D);
534 if (!Tok.
is(tok::l_brace)) {
549 !isa<FunctionTemplateDecl>(LM.D) ||
550 cast<FunctionTemplateDecl>(LM.D)->getTemplateParameters()->getDepth()
551 < TemplateParameterDepth) &&
552 "TemplateParameterDepth should be greater than the depth of " 553 "current template being instantiated!");
555 ParseFunctionStatementBody(LM.D, FnScope);
563 if (
auto *FD = dyn_cast_or_null<FunctionDecl>(LM.D))
564 if (isa<CXXMethodDecl>(FD) ||
572 void Parser::ParseLexedMemberInitializers(ParsingClass &Class) {
573 bool HasTemplateScope = !Class.TopLevelClass && Class.TemplateScope;
576 TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);
577 if (HasTemplateScope) {
579 ++CurTemplateDepthTracker;
582 bool AlreadyHasClassScope = Class.TopLevelClass;
584 ParseScope ClassScope(
this, ScopeFlags, !AlreadyHasClassScope);
585 ParseScopeFlags ClassScopeFlags(
this, ScopeFlags, AlreadyHasClassScope);
587 if (!AlreadyHasClassScope)
589 Class.TagOrTemplate);
591 if (!Class.LateParsedDeclarations.empty()) {
600 for (
size_t i = 0; i < Class.LateParsedDeclarations.size(); ++i) {
601 Class.LateParsedDeclarations[i]->ParseLexedMemberInitializers();
605 if (!AlreadyHasClassScope)
607 Class.TagOrTemplate);
612 void Parser::ParseLexedMemberInitializer(LateParsedMemberInitializer &MI) {
613 if (!MI.Field || MI.Field->isInvalidDecl())
620 MI.Toks.push_back(Tok);
621 PP.EnterTokenStream(MI.Toks,
true);
630 ExprResult Init = ParseCXXMemberInitializer(MI.Field,
false,
643 Diag(EndLoc, diag::err_expected_semi_decl_list);
666 bool isFirstTokenConsumed =
true;
669 if (Tok.
is(T1) || Tok.
is(T2)) {
670 if (ConsumeFinalToken) {
679 case tok::annot_module_begin:
680 case tok::annot_module_end:
681 case tok::annot_module_include:
689 ConsumeAndStoreUntil(tok::r_paren, Toks,
false);
695 ConsumeAndStoreUntil(tok::r_square, Toks,
false);
701 ConsumeAndStoreUntil(tok::r_brace, Toks,
false);
710 if (ParenCount && !isFirstTokenConsumed)
716 if (BracketCount && !isFirstTokenConsumed)
722 if (BraceCount && !isFirstTokenConsumed)
738 isFirstTokenConsumed =
false;
748 bool Parser::ConsumeAndStoreFunctionPrologue(
CachedTokens &Toks) {
749 if (Tok.
is(tok::kw_try)) {
754 if (Tok.
isNot(tok::colon)) {
760 ConsumeAndStoreUntil(tok::l_brace, tok::r_brace, Toks,
763 if (Tok.
isNot(tok::l_brace))
784 bool MightBeTemplateArgument =
false;
788 if (Tok.
is(tok::kw_decltype)) {
791 if (Tok.
isNot(tok::l_paren))
796 if (!ConsumeAndStoreUntil(tok::r_paren, Toks,
true)) {
798 Diag(OpenLoc, diag::note_matching) << tok::l_paren;
804 if (Tok.
is(tok::coloncolon)) {
808 if (Tok.
is(tok::kw_template)) {
814 if (Tok.
is(tok::identifier)) {
820 }
while (Tok.
is(tok::coloncolon));
822 if (Tok.
is(tok::code_completion)) {
824 ConsumeCodeCompletionToken();
825 if (Tok.
isOneOf(tok::identifier, tok::coloncolon, tok::kw_decltype)) {
832 if (Tok.
is(tok::comma)) {
838 if (Tok.
is(tok::less))
839 MightBeTemplateArgument =
true;
841 if (MightBeTemplateArgument) {
848 if (!ConsumeAndStoreUntil(tok::l_paren, tok::l_brace, Toks,
855 }
else if (Tok.
isNot(tok::l_paren) && Tok.
isNot(tok::l_brace)) {
859 << tok::l_paren << tok::l_brace;
866 bool IsLParen = (kind == tok::l_paren);
872 assert(kind == tok::l_brace &&
"Must be left paren or brace here.");
879 const Token &PreviousToken = Toks[Toks.size() - 2];
880 if (!MightBeTemplateArgument &&
881 !PreviousToken.
isOneOf(tok::identifier, tok::greater,
882 tok::greatergreater)) {
888 TentativeParsingAction PA(*
this);
890 !Tok.
isOneOf(tok::comma, tok::ellipsis, tok::l_brace)) {
903 tok::TokenKind CloseKind = IsLParen ? tok::r_paren : tok::r_brace;
904 if (!ConsumeAndStoreUntil(CloseKind, Toks,
true)) {
905 Diag(Tok, diag::err_expected) << CloseKind;
906 Diag(OpenLoc, diag::note_matching) <<
kind;
911 if (Tok.
is(tok::ellipsis)) {
918 if (Tok.
is(tok::comma)) {
921 }
else if (Tok.
is(tok::l_brace)) {
939 }
else if (!MightBeTemplateArgument) {
940 return Diag(Tok.
getLocation(), diag::err_expected_either) << tok::l_brace
948 bool Parser::ConsumeAndStoreConditional(
CachedTokens &Toks) {
950 assert(Tok.
is(tok::question));
954 while (Tok.
isNot(tok::colon)) {
955 if (!ConsumeAndStoreUntil(tok::question, tok::colon, Toks,
961 if (Tok.
is(tok::question) && !ConsumeAndStoreConditional(Toks))
976 : TentativeParsingAction(Self), Self(Self), EndKind(EndKind) {
979 TentativeParsingAction Inner(Self);
980 Self.ConsumeAndStoreUntil(EndKind, Toks,
true,
false);
990 auto Buffer = llvm::make_unique<Token[]>(Toks.size());
991 std::copy(Toks.begin() + 1, Toks.end(), Buffer.get());
992 Buffer[Toks.size() - 1] = Self.Tok;
993 Self.PP.EnterTokenStream(std::move(Buffer), Toks.size(),
true);
995 Self.Tok = Toks.front();
1011 bool Parser::ConsumeAndStoreInitializer(
CachedTokens &Toks,
1012 CachedInitKind CIK) {
1014 bool IsFirstToken =
true;
1019 unsigned AngleCount = 0;
1020 unsigned KnownTemplateCount = 0;
1023 switch (Tok.getKind()) {
1029 if (KnownTemplateCount)
1043 CIK == CIK_DefaultInitializer
1044 ? tok::semi : tok::r_paren);
1047 TPResult
Result = TPResult::Error;
1050 case CIK_DefaultInitializer:
1051 Result = TryParseInitDeclaratorList();
1054 if (Result == TPResult::Ambiguous && Tok.
isNot(tok::semi))
1055 Result = TPResult::False;
1058 case CIK_DefaultArgument:
1059 bool InvalidAsDeclaration =
false;
1060 Result = TryParseParameterDeclarationClause(
1061 &InvalidAsDeclaration,
true);
1064 if (Result == TPResult::Ambiguous && InvalidAsDeclaration)
1065 Result = TPResult::False;
1070 if (Result != TPResult::False && Result != TPResult::Error) {
1083 ++KnownTemplateCount;
1087 case tok::annot_module_begin:
1088 case tok::annot_module_end:
1089 case tok::annot_module_include:
1102 if (!ConsumeAndStoreConditional(Toks))
1106 case tok::greatergreatergreater:
1109 if (AngleCount) --AngleCount;
1110 if (KnownTemplateCount) --KnownTemplateCount;
1112 case tok::greatergreater:
1115 if (AngleCount) --AngleCount;
1116 if (KnownTemplateCount) --KnownTemplateCount;
1119 if (AngleCount) --AngleCount;
1120 if (KnownTemplateCount) --KnownTemplateCount;
1123 case tok::kw_template:
1127 Toks.push_back(Tok);
1129 if (Tok.
is(tok::identifier)) {
1130 Toks.push_back(Tok);
1132 if (Tok.
is(tok::less)) {
1134 ++KnownTemplateCount;
1135 Toks.push_back(Tok);
1141 case tok::kw_operator:
1144 Toks.push_back(Tok);
1146 switch (Tok.getKind()) {
1148 case tok::greatergreatergreater:
1149 case tok::greatergreater:
1152 Toks.push_back(Tok);
1162 Toks.push_back(Tok);
1164 ConsumeAndStoreUntil(tok::r_paren, Toks,
false);
1168 Toks.push_back(Tok);
1170 ConsumeAndStoreUntil(tok::r_square, Toks,
false);
1174 Toks.push_back(Tok);
1176 ConsumeAndStoreUntil(tok::r_brace, Toks,
false);
1186 if (CIK == CIK_DefaultArgument)
1188 if (ParenCount && !IsFirstToken)
1190 Toks.push_back(Tok);
1194 if (BracketCount && !IsFirstToken)
1196 Toks.push_back(Tok);
1200 if (BraceCount && !IsFirstToken)
1202 Toks.push_back(Tok);
1206 case tok::code_completion:
1207 Toks.push_back(Tok);
1208 ConsumeCodeCompletionToken();
1211 case tok::string_literal:
1212 case tok::wide_string_literal:
1213 case tok::utf8_string_literal:
1214 case tok::utf16_string_literal:
1215 case tok::utf32_string_literal:
1216 Toks.push_back(Tok);
1217 ConsumeStringToken();
1220 if (CIK == CIK_DefaultInitializer)
1225 Toks.push_back(Tok);
1229 IsFirstToken =
false;
void ActOnFinishDelayedMemberInitializers(Decl *Record)
Represents a function declaration or definition.
bool hasErrorOccurred() const
SourceLocation getLocWithOffset(int Offset) const
Return a source location with the specified offset from this SourceLocation.
This is a scope that corresponds to the parameters within a function prototype.
bool is(tok::TokenKind K) const
is/isNot - Predicates to check if this token is a specific kind, as in "if (Tok.is(tok::l_brace)) {...
void ActOnStartDelayedCXXMethodDeclaration(Scope *S, Decl *Method)
ActOnStartDelayedCXXMethodDeclaration - We have completed parsing a top-level (non-nested) C++ class...
Decl - This represents one declaration (or definition), e.g.
Defines the C++ template declaration subclasses.
bool isTemplateParamScope() const
isTemplateParamScope - Return true if this scope is a C++ template parameter scope.
This indicates that the scope corresponds to a function, which means that labels are set here...
void ActOnFinishDelayedCXXMethodDeclaration(Scope *S, Decl *Method)
ActOnFinishDelayedCXXMethodDeclaration - We have finished processing the delayed method declaration f...
bool isFunctionDeclarator(unsigned &idx) const
isFunctionDeclarator - This method returns true if the declarator is a function declarator (looking t...
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
Parser - This implements a parser for the C family of languages.
void ActOnDefaultCtorInitializers(Decl *CDtorDecl)
RAII object that enters a new expression evaluation context.
void ActOnStartDelayedMemberDeclarations(Scope *S, Decl *Record)
RAII object used to temporarily allow the C++ 'this' expression to be used, with the given qualifiers...
RAII object that makes sure paren/bracket/brace count is correct after declaration/statement parsing...
bool canSkipFunctionBody(Decl *D)
Determine whether we can skip parsing the body of a function definition, assuming we don't care about...
Represents a parameter to a function.
void MarkAsLateParsedTemplate(FunctionDecl *FD, Decl *FnD, CachedTokens &Toks)
tok::TokenKind getKind() const
bool SkipUntil(tok::TokenKind T, SkipUntilFlags Flags=static_cast< SkipUntilFlags >(0))
SkipUntil - Read tokens until we get to the specified token, then consume it (unless StopBeforeMatch ...
Decl * ActOnStartOfFunctionDef(Scope *S, Declarator &D, MultiTemplateParamsArg TemplateParamLists, SkipBodyInfo *SkipBody=nullptr)
SourceLocation getLocForEndOfToken(SourceLocation Loc, unsigned Offset=0)
Computes the source location just past the end of the token at this source location.
bool TryConsumeToken(tok::TokenKind Expected)
void setUninstantiatedDefaultArg(Expr *arg)
This declaration is a friend function.
Token - This structure provides full information about a lexed token.
bool isInIdentifierNamespace(unsigned NS) const
void setKind(tok::TokenKind K)
RAII class used to indicate that we are performing provisional semantic analysis to determine the val...
ExprResult CorrectDelayedTyposInExpr(Expr *E, VarDecl *InitDecl=nullptr, llvm::function_ref< ExprResult(Expr *)> Filter=[](Expr *E) -> ExprResult { return E;})
Process any TypoExprs in the given Expr and its children, generating diagnostics as appropriate and r...
const ParsingDeclSpec & getDeclSpec() const
Scope - A scope is a transient data structure that is used while parsing the program.
bool hasUnparsedDefaultArg() const
Determines whether this parameter has a default argument that has not yet been parsed.
SourceLocation ConsumeAnyToken(bool ConsumeCodeCompletionTok=false)
ConsumeAnyToken - Dispatch to the right Consume* method based on the current token type...
Decl * ActOnFinishFunctionBody(Decl *Decl, Stmt *Body)
DiagnosticsEngine & getDiagnostics() const
A class for parsing a declarator.
UnannotatedTentativeParsingAction(Parser &Self, tok::TokenKind EndKind)
The current expression is potentially evaluated, but any declarations referenced inside that expressi...
This file defines the classes used to store parsed information about declaration-specifiers and decla...
void SkipMalformedDecl()
SkipMalformedDecl - Read tokens until we get to some likely good stopping point for skipping past a s...
void setEofData(const void *D)
SourceLocation getLocation() const
Return a source location identifier for the specified offset in the current file. ...
bool isConstexprSpecified() const
void ActOnFinishCXXInClassMemberInitializer(Decl *VarDecl, SourceLocation EqualLoc, Expr *Init)
This is invoked after parsing an in-class initializer for a non-static C++ class member, and after instantiating an in-class initializer in a class template.
void ActOnDelayedCXXMethodParameter(Scope *S, Decl *Param)
ActOnDelayedCXXMethodParameter - We've already started a delayed C++ method declaration.
This is a compound statement scope.
void SetDeclDeleted(Decl *dcl, SourceLocation DelLoc)
bool isDependentContext() const
Determines whether this context is dependent on a template parameter.
bool isFriendSpecified() const
The result type of a method or function.
const LangOptions & getLangOpts() const
This is a scope that corresponds to the parameters within a function prototype for a function declara...
void CheckForFunctionRedefinition(FunctionDecl *FD, const FunctionDecl *EffectiveDefinition=nullptr, SkipBodyInfo *SkipBody=nullptr)
Decl * ActOnSkippedFunctionBody(Decl *Decl)
void ActOnStartCXXInClassMemberInitializer()
Enter a new C++ default initializer scope.
Stop skipping at semicolon.
ActionResult - This structure is used while parsing/acting on expressions, stmts, etc...
FunctionDecl * getAsFunction() LLVM_READONLY
Returns the function itself, or the templated function if this is a function template.
Encodes a location in the source.
void ActOnFinishDelayedMemberDeclarations(Scope *S, Decl *Record)
FunctionDefinitionKind getFunctionDefinitionKind() const
void ProcessDeclAttributeList(Scope *S, Decl *D, const ParsedAttributesView &AL, bool IncludeCXX11Attributes=true)
ProcessDeclAttributeList - Apply all the decl attributes in the specified attribute list to the speci...
Represents a static or instance method of a struct/union/class.
void SetDeclDefaulted(Decl *dcl, SourceLocation DefaultLoc)
A tentative parsing action that can also revert token annotations.
const void * getEofData() const
void actOnDelayedExceptionSpecification(Decl *Method, ExceptionSpecificationType EST, SourceRange SpecificationRange, ArrayRef< ParsedType > DynamicExceptions, ArrayRef< SourceRange > DynamicExceptionRanges, Expr *NoexceptExpr)
Add an exception-specification to the given member function (or member function template).
TokenKind
Provides a simple uniform namespace for tokens from all C languages.
Represents a C++11 virt-specifier-seq.
bool hasUninstantiatedDefaultArg() const
Scope * getCurScope() const
void ActOnFinishInlineFunctionDef(FunctionDecl *D)
The scope of a struct/union/class definition.
bool isNot(tok::TokenKind K) const
Dataflow Directional Tag Classes.
bool isValid() const
Return true if this is a valid SourceLocation object.
void ActOnParamDefaultArgument(Decl *param, SourceLocation EqualLoc, Expr *defarg)
ActOnParamDefaultArgument - Check whether the default argument provided for a function parameter is w...
const Expr * getInit() const
This is a scope that corresponds to the template parameters of a C++ template.
void setWillHaveBody(bool V=true)
bool isOneOf(tok::TokenKind K1, tok::TokenKind K2) const
Expr * getUninstantiatedDefaultArg()
DiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID)
NamedDecl * ActOnCXXMemberDeclarator(Scope *S, AccessSpecifier AS, Declarator &D, MultiTemplateParamsArg TemplateParameterLists, Expr *BitfieldWidth, const VirtSpecifiers &VS, InClassInitStyle InitStyle)
ActOnCXXMemberDeclarator - This is invoked when a C++ class member declarator is parsed.
ExprResult ParseAssignmentExpression(TypeCastState isTypeCast=NotTypeCast)
Parse an expr that doesn't include (top-level) commas.
ExceptionSpecificationType
The various types of exception specifications that exist in C++11.
This is a scope that can contain a declaration.
void ActOnParamDefaultArgumentError(Decl *param, SourceLocation EqualLoc)
ActOnParamDefaultArgumentError - Parsing or semantic analysis of the default argument for the paramet...
SourceLocation ConsumeToken()
ConsumeToken - Consume the current 'peek token' and lex the next one.
void ActOnPureSpecifier(Decl *D, SourceLocation PureSpecLoc)
DeclContext * CurContext
CurContext - This is the current declaration context of parsing.
unsigned kind
All of the diagnostics that can be emitted by the frontend.
void setLocation(SourceLocation L)
A trivial tuple used to represent a source range.
This represents a decl that may have a name.
ParsedAttributes - A collection of parsed attributes.
Declaration of a template function.
bool IsInsideALocalClassWithinATemplateFunction()
void startToken()
Reset all flags to cleared.
Stop skipping at specified token, but don't skip the token itself.
NamedDecl * ActOnFriendFunctionDecl(Scope *S, Declarator &D, MultiTemplateParamsArg TemplateParams)
unsigned ActOnReenterTemplateScope(Scope *S, Decl *Template)
SourceLocation getEndLoc() const