20 using namespace clang;
28 const ParsedTemplateInfo &TemplateInfo,
32 assert(Tok.
isOneOf(tok::l_brace, tok::colon, tok::kw_try, tok::equal) &&
33 "Current token not a '{', ':', '=', or 'try'!");
36 TemplateInfo.TemplateParams ? TemplateInfo.TemplateParams->data()
38 TemplateInfo.TemplateParams ? TemplateInfo.TemplateParams->size() : 0);
46 TemplateParams,
nullptr,
55 HandleMemberFunctionDeclDelays(D, FnD);
70 ? diag::warn_cxx98_compat_defaulted_deleted_function
71 : diag::ext_defaulted_deleted_function)
75 if (
auto *DeclAsFunction = dyn_cast<FunctionDecl>(FnD)) {
76 DeclAsFunction->setRangeEnd(KWEndLoc);
80 ? diag::warn_cxx98_compat_defaulted_deleted_function
81 : diag::ext_defaulted_deleted_function)
84 if (
auto *DeclAsFunction = dyn_cast<FunctionDecl>(FnD)) {
85 DeclAsFunction->setRangeEnd(KWEndLoc);
88 llvm_unreachable(
"function definition after = not 'delete' or 'default'");
91 if (Tok.
is(tok::comma)) {
92 Diag(KWLoc, diag::err_default_delete_in_multiple_declaration)
95 }
else if (ExpectAndConsume(tok::semi, diag::err_expected_after,
96 Delete ?
"delete" :
"default")) {
109 !(FnD && FnD->getAsFunction() &&
110 FnD->getAsFunction()->getReturnType()->getContainedAutoType()) &&
112 (TemplateInfo.Kind != ParsedTemplateInfo::NonTemplate &&
113 TemplateInfo.Kind != ParsedTemplateInfo::ExplicitSpecialization)) &&
117 LexTemplateFunctionForLateParsing(Toks);
130 LexedMethod* LM =
new LexedMethod(
this, FnD);
131 getCurrentClass().LateParsedDeclarations.push_back(LM);
138 if (ConsumeAndStoreFunctionPrologue(Toks)) {
145 delete getCurrentClass().LateParsedDeclarations.back();
146 getCurrentClass().LateParsedDeclarations.pop_back();
150 ConsumeAndStoreUntil(tok::r_brace, Toks,
false);
154 if (kind == tok::kw_try) {
155 while (Tok.
is(tok::kw_catch)) {
156 ConsumeAndStoreUntil(tok::l_brace, Toks,
false);
157 ConsumeAndStoreUntil(tok::r_brace, Toks,
false);
179 delete getCurrentClass().LateParsedDeclarations.back();
180 getCurrentClass().LateParsedDeclarations.pop_back();
190 void Parser::ParseCXXNonStaticMemberInitializer(
Decl *VarD) {
191 assert(Tok.
isOneOf(tok::l_brace, tok::equal) &&
192 "Current token not a '{' or '='!");
194 LateParsedMemberInitializer *MI =
195 new LateParsedMemberInitializer(
this, VarD);
196 getCurrentClass().LateParsedDeclarations.push_back(MI);
200 if (kind == tok::equal) {
205 if (kind == tok::l_brace) {
211 ConsumeAndStoreUntil(tok::r_brace, Toks,
true);
214 ConsumeAndStoreInitializer(Toks, CIK_DefaultInitializer);
227 Parser::LateParsedDeclaration::~LateParsedDeclaration() {}
228 void Parser::LateParsedDeclaration::ParseLexedMethodDeclarations() {}
229 void Parser::LateParsedDeclaration::ParseLexedMemberInitializers() {}
230 void Parser::LateParsedDeclaration::ParseLexedMethodDefs() {}
232 Parser::LateParsedClass::LateParsedClass(
Parser *
P, ParsingClass *
C)
233 : Self(P), Class(C) {}
235 Parser::LateParsedClass::~LateParsedClass() {
236 Self->DeallocateParsedClasses(Class);
239 void Parser::LateParsedClass::ParseLexedMethodDeclarations() {
240 Self->ParseLexedMethodDeclarations(*Class);
243 void Parser::LateParsedClass::ParseLexedMemberInitializers() {
244 Self->ParseLexedMemberInitializers(*Class);
247 void Parser::LateParsedClass::ParseLexedMethodDefs() {
248 Self->ParseLexedMethodDefs(*Class);
251 void Parser::LateParsedMethodDeclaration::ParseLexedMethodDeclarations() {
252 Self->ParseLexedMethodDeclaration(*
this);
255 void Parser::LexedMethod::ParseLexedMethodDefs() {
256 Self->ParseLexedMethodDef(*
this);
259 void Parser::LateParsedMemberInitializer::ParseLexedMemberInitializers() {
260 Self->ParseLexedMemberInitializer(*
this);
267 void Parser::ParseLexedMethodDeclarations(ParsingClass &Class) {
268 bool HasTemplateScope = !Class.TopLevelClass && Class.TemplateScope;
271 TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);
272 if (HasTemplateScope) {
274 ++CurTemplateDepthTracker;
279 bool HasClassScope = !Class.TopLevelClass;
284 Class.TagOrTemplate);
286 for (
size_t i = 0; i < Class.LateParsedDeclarations.size(); ++i) {
287 Class.LateParsedDeclarations[i]->ParseLexedMethodDeclarations();
292 Class.TagOrTemplate);
295 void Parser::ParseLexedMethodDeclaration(LateParsedMethodDeclaration &LM) {
298 TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);
299 if (LM.TemplateScope) {
301 ++CurTemplateDepthTracker;
310 for (
unsigned I = 0, N = LM.DefaultArgs.size();
I != N; ++
I) {
311 auto Param = cast<ParmVarDecl>(LM.DefaultArgs[
I].Param);
313 bool HasUnparsed = Param->hasUnparsedDefaultArg();
318 Token LastDefaultArgToken = Toks->back();
324 Toks->push_back(DefArgEnd);
327 Toks->push_back(Tok);
334 assert(Tok.
is(tok::equal) &&
"Default argument not starting with '='");
345 Diag(Tok, diag::warn_cxx98_compat_generalized_initializer_lists);
346 DefArgResult = ParseBraceInitializer();
357 assert(Toks->size() >= 3 &&
"expected a token in default arg");
360 (*Toks)[Toks->size() - 3].getLocation());
375 LM.DefaultArgs[
I].Toks =
nullptr;
376 }
else if (HasUnparsed) {
377 assert(Param->hasInheritedDefaultArg());
378 FunctionDecl *Old = cast<FunctionDecl>(LM.Method)->getPreviousDecl();
383 Param->getUninstantiatedDefaultArg());
385 Param->setDefaultArg(OldParam->
getInit());
392 Token LastExceptionSpecToken = Toks->back();
393 Token ExceptionSpecEnd;
398 Toks->push_back(ExceptionSpecEnd);
401 Toks->push_back(Tok);
415 = dyn_cast<FunctionTemplateDecl>(LM.Method))
416 Method = cast<CXXMethodDecl>(FunTmpl->getTemplatedDecl());
418 Method = cast<CXXMethodDecl>(LM.Method);
421 Method->getTypeQualifiers(),
432 = tryParseExceptionSpecification(
false, SpecificationRange,
434 DynamicExceptionRanges, NoexceptExpr,
435 ExceptionSpecTokens);
444 DynamicExceptionRanges,
446 NoexceptExpr.
get() :
nullptr);
458 LM.ExceptionSpecTokens =
nullptr;
461 PrototypeScope.Exit();
470 void Parser::ParseLexedMethodDefs(ParsingClass &Class) {
471 bool HasTemplateScope = !Class.TopLevelClass && Class.TemplateScope;
473 TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);
474 if (HasTemplateScope) {
476 ++CurTemplateDepthTracker;
478 bool HasClassScope = !Class.TopLevelClass;
482 for (
size_t i = 0; i < Class.LateParsedDeclarations.size(); ++i) {
483 Class.LateParsedDeclarations[i]->ParseLexedMethodDefs();
487 void Parser::ParseLexedMethodDef(LexedMethod &LM) {
490 TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);
491 if (LM.TemplateScope) {
493 ++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);
510 ConsumeAnyToken(
true);
511 assert(Tok.
isOneOf(tok::l_brace, tok::colon, tok::kw_try)
512 &&
"Inline method not starting with '{', ':' or 'try'");
519 if (Tok.
is(tok::kw_try)) {
520 ParseFunctionTryBlock(LM.D, FnScope);
529 if (Tok.
is(tok::colon)) {
530 ParseConstructorInitializer(LM.D);
533 if (!Tok.
is(tok::l_brace)) {
548 !isa<FunctionTemplateDecl>(LM.D) ||
549 cast<FunctionTemplateDecl>(LM.D)->getTemplateParameters()->getDepth()
550 < TemplateParameterDepth) &&
551 "TemplateParameterDepth should be greater than the depth of "
552 "current template being instantiated!");
554 ParseFunctionStatementBody(LM.D, FnScope);
558 LM.D->getAsFunction()->setLateTemplateParsed(
false);
566 if (
CXXMethodDecl *MD = dyn_cast_or_null<CXXMethodDecl>(LM.D))
573 void Parser::ParseLexedMemberInitializers(ParsingClass &Class) {
574 bool HasTemplateScope = !Class.TopLevelClass && Class.TemplateScope;
577 TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);
578 if (HasTemplateScope) {
580 ++CurTemplateDepthTracker;
583 bool AlreadyHasClassScope = Class.TopLevelClass;
585 ParseScope ClassScope(
this, ScopeFlags, !AlreadyHasClassScope);
586 ParseScopeFlags ClassScopeFlags(
this, ScopeFlags, AlreadyHasClassScope);
588 if (!AlreadyHasClassScope)
590 Class.TagOrTemplate);
592 if (!Class.LateParsedDeclarations.empty()) {
601 for (
size_t i = 0; i < Class.LateParsedDeclarations.size(); ++i) {
602 Class.LateParsedDeclarations[i]->ParseLexedMemberInitializers();
606 if (!AlreadyHasClassScope)
608 Class.TagOrTemplate);
613 void Parser::ParseLexedMemberInitializer(LateParsedMemberInitializer &MI) {
614 if (!MI.Field || MI.Field->isInvalidDecl())
619 MI.Toks.push_back(Tok);
623 ConsumeAnyToken(
true);
629 ExprResult Init = ParseCXXMemberInitializer(MI.Field,
false,
642 Diag(EndLoc, diag::err_expected_semi_decl_list);
662 bool StopAtSemi,
bool ConsumeFinalToken) {
665 bool isFirstTokenConsumed =
true;
668 if (Tok.
is(T1) || Tok.
is(T2)) {
669 if (ConsumeFinalToken) {
678 case tok::annot_module_begin:
679 case tok::annot_module_end:
680 case tok::annot_module_include:
688 ConsumeAndStoreUntil(tok::r_paren, Toks,
false);
694 ConsumeAndStoreUntil(tok::r_square, Toks,
false);
700 ConsumeAndStoreUntil(tok::r_brace, Toks,
false);
709 if (ParenCount && !isFirstTokenConsumed)
715 if (BracketCount && !isFirstTokenConsumed)
721 if (BraceCount && !isFirstTokenConsumed)
727 case tok::code_completion:
729 ConsumeCodeCompletionToken();
732 case tok::string_literal:
733 case tok::wide_string_literal:
734 case tok::utf8_string_literal:
735 case tok::utf16_string_literal:
736 case tok::utf32_string_literal:
738 ConsumeStringToken();
750 isFirstTokenConsumed =
false;
760 bool Parser::ConsumeAndStoreFunctionPrologue(
CachedTokens &Toks) {
761 if (Tok.
is(tok::kw_try)) {
766 if (Tok.
isNot(tok::colon)) {
772 ConsumeAndStoreUntil(tok::l_brace, tok::r_brace, Toks,
775 if (Tok.
isNot(tok::l_brace))
796 bool MightBeTemplateArgument =
false;
800 if (Tok.
is(tok::kw_decltype)) {
803 if (Tok.
isNot(tok::l_paren))
808 if (!ConsumeAndStoreUntil(tok::r_paren, Toks,
true)) {
810 Diag(OpenLoc, diag::note_matching) << tok::l_paren;
816 if (Tok.
is(tok::coloncolon)) {
820 if (Tok.
is(tok::kw_template)) {
826 if (Tok.
isOneOf(tok::identifier, tok::kw_template)) {
829 }
else if (Tok.
is(tok::code_completion)) {
831 ConsumeCodeCompletionToken();
835 MightBeTemplateArgument =
true;
840 }
while (Tok.
is(tok::coloncolon));
842 if (Tok.
is(tok::less))
843 MightBeTemplateArgument =
true;
845 if (MightBeTemplateArgument) {
852 if (!ConsumeAndStoreUntil(tok::l_paren, tok::l_brace, Toks,
859 }
else if (Tok.
isNot(tok::l_paren) && Tok.
isNot(tok::l_brace)) {
863 << tok::l_paren << tok::l_brace;
870 bool IsLParen = (kind == tok::l_paren);
876 assert(kind == tok::l_brace &&
"Must be left paren or brace here.");
887 tok::TokenKind CloseKind = IsLParen ? tok::r_paren : tok::r_brace;
888 if (!ConsumeAndStoreUntil(CloseKind, Toks,
true)) {
889 Diag(Tok, diag::err_expected) << CloseKind;
890 Diag(OpenLoc, diag::note_matching) <<
kind;
895 if (Tok.
is(tok::ellipsis)) {
902 if (Tok.
is(tok::comma)) {
905 }
else if (Tok.
is(tok::l_brace)) {
923 }
else if (!MightBeTemplateArgument) {
924 return Diag(Tok.
getLocation(), diag::err_expected_either) << tok::l_brace
932 bool Parser::ConsumeAndStoreConditional(
CachedTokens &Toks) {
934 assert(Tok.
is(tok::question));
938 while (Tok.
isNot(tok::colon)) {
939 if (!ConsumeAndStoreUntil(tok::question, tok::colon, Toks,
945 if (Tok.
is(tok::question) && !ConsumeAndStoreConditional(Toks))
960 : TentativeParsingAction(Self), Self(Self), EndKind(EndKind) {
963 TentativeParsingAction Inner(Self);
964 Self.ConsumeAndStoreUntil(EndKind, Toks,
true,
false);
975 std::copy(Toks.begin() + 1, Toks.end(),
Buffer);
976 Buffer[Toks.size() - 1] = Self.Tok;
977 Self.PP.EnterTokenStream(Buffer, Toks.size(),
true,
true);
979 Self.Tok = Toks.front();
995 bool Parser::ConsumeAndStoreInitializer(
CachedTokens &Toks,
996 CachedInitKind CIK) {
1003 unsigned AngleCount = 0;
1004 unsigned KnownTemplateCount = 0;
1013 if (KnownTemplateCount)
1026 UnannotatedTentativeParsingAction PA(*
this,
1027 CIK == CIK_DefaultInitializer
1028 ? tok::semi : tok::r_paren);
1034 case CIK_DefaultInitializer:
1035 Result = TryParseInitDeclaratorList();
1042 case CIK_DefaultArgument:
1043 bool InvalidAsDeclaration =
false;
1044 Result = TryParseParameterDeclarationClause(
1045 &InvalidAsDeclaration,
true);
1063 PA.RevertAnnotations();
1067 ++KnownTemplateCount;
1071 case tok::annot_module_begin:
1072 case tok::annot_module_end:
1073 case tok::annot_module_include:
1086 if (!ConsumeAndStoreConditional(Toks))
1090 case tok::greatergreatergreater:
1093 if (AngleCount) --AngleCount;
1094 if (KnownTemplateCount) --KnownTemplateCount;
1096 case tok::greatergreater:
1099 if (AngleCount) --AngleCount;
1100 if (KnownTemplateCount) --KnownTemplateCount;
1103 if (AngleCount) --AngleCount;
1104 if (KnownTemplateCount) --KnownTemplateCount;
1107 case tok::kw_template:
1111 Toks.push_back(Tok);
1113 if (Tok.
is(tok::identifier)) {
1114 Toks.push_back(Tok);
1116 if (Tok.
is(tok::less)) {
1118 ++KnownTemplateCount;
1119 Toks.push_back(Tok);
1125 case tok::kw_operator:
1128 Toks.push_back(Tok);
1132 case tok::greatergreatergreater:
1133 case tok::greatergreater:
1136 Toks.push_back(Tok);
1146 Toks.push_back(Tok);
1148 ConsumeAndStoreUntil(tok::r_paren, Toks,
false);
1152 Toks.push_back(Tok);
1154 ConsumeAndStoreUntil(tok::r_square, Toks,
false);
1158 Toks.push_back(Tok);
1160 ConsumeAndStoreUntil(tok::r_brace, Toks,
false);
1170 if (CIK == CIK_DefaultArgument)
1172 if (ParenCount && !IsFirstToken)
1174 Toks.push_back(Tok);
1178 if (BracketCount && !IsFirstToken)
1180 Toks.push_back(Tok);
1184 if (BraceCount && !IsFirstToken)
1186 Toks.push_back(Tok);
1190 case tok::code_completion:
1191 Toks.push_back(Tok);
1192 ConsumeCodeCompletionToken();
1195 case tok::string_literal:
1196 case tok::wide_string_literal:
1197 case tok::utf8_string_literal:
1198 case tok::utf16_string_literal:
1199 case tok::utf32_string_literal:
1200 Toks.push_back(Tok);
1201 ConsumeStringToken();
1204 if (CIK == CIK_DefaultInitializer)
1209 Toks.push_back(Tok);
1213 IsFirstToken =
false;
void ActOnFinishDelayedMemberInitializers(Decl *Record)
FunctionDecl - An instance of this class is created to represent a function declaration or definition...
This is a scope that corresponds to the parameters within a function prototype.
const LangOptions & getLangOpts() const
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 hasErrorOccurred() const
FunctionDefinitionKind getFunctionDefinitionKind() const
This indicates that the scope corresponds to a function, which means that labels are set here...
bool isDependentContext() const
Determines whether this context is dependent on a template parameter.
void ActOnFinishDelayedCXXMethodDeclaration(Scope *S, Decl *Method)
ActOnFinishDelayedCXXMethodDeclaration - We have finished processing the delayed method declaration f...
std::unique_ptr< llvm::MemoryBuffer > Buffer
const Expr * getInit() const
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...
const ParsingDeclSpec & getDeclSpec() const
ParmVarDecl - Represents a parameter to a function.
void MarkAsLateParsedTemplate(FunctionDecl *FD, Decl *FnD, CachedTokens &Toks)
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)
bool hasUninstantiatedDefaultArg() const
void setUninstantiatedDefaultArg(Expr *arg)
Token - This structure provides full information about a lexed token.
void setKind(tok::TokenKind K)
The current expression is potentially evaluated, but any declarations referenced inside that expressi...
SourceLocation getLocWithOffset(int Offset) const
Return a source location with the specified offset from this SourceLocation.
RAII class used to indicate that we are performing provisional semantic analysis to determine the val...
Scope - A scope is a transient data structure that is used while parsing the program.
void ActOnFinishInlineMethodDef(CXXMethodDecl *D)
tok::TokenKind getKind() const
Decl * ActOnFinishFunctionBody(Decl *Decl, Stmt *Body)
detail::InMemoryDirectory::const_iterator I
void ProcessDeclAttributeList(Scope *S, Decl *D, const AttributeList *AL, bool IncludeCXX11Attributes=true)
ProcessDeclAttributeList - Apply all the decl attributes in the specified attribute list to the speci...
bool isFunctionDeclarator(unsigned &idx) const
isFunctionDeclarator - This method returns true if the declarator is a function declarator (looking t...
const void * getEofData() const
A class for parsing a declarator.
UnannotatedTentativeParsingAction(Parser &Self, tok::TokenKind EndKind)
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)
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.
void setLateTemplateParsed(bool ILT=true)
SourceLocation getLocation() const
Return a source location identifier for the specified offset in the current file. ...
bool isConstexprSpecified() const
bool isNot(tok::TokenKind K) const
void SetDeclDeleted(Decl *dcl, SourceLocation DelLoc)
DiagnosticsEngine & getDiagnostics() const
The result type of a method or function.
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)
void ActOnStartCXXInClassMemberInitializer()
Enter a new C++ default initializer scope.
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)
SourceLocation getEndLoc() const
bool isValid() const
Return true if this is a valid SourceLocation object.
Scope * getCurScope() const
void EnterTokenStream(const Token *Toks, unsigned NumToks, bool DisableMacroExpansion, bool OwnsTokens)
Add a "macro" context to the top of the include stack, which will cause the lexer to start returning ...
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.
bool isTemplateParamScope() const
isTemplateParamScope - Return true if this scope is a C++ template parameter scope.
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 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)) {...
The scope of a struct/union/class definition.
bool hasUnparsedDefaultArg() const
hasUnparsedDefaultArg - Determines whether this parameter has a default argument that has not yet bee...
bool isFriendSpecified() const
void ActOnParamDefaultArgument(Decl *param, SourceLocation EqualLoc, Expr *defarg)
ActOnParamDefaultArgument - Check whether the default argument provided for a function parameter is w...
This is a scope that corresponds to the template parameters of a C++ template.
bool isOneOf(tok::TokenKind K1, tok::TokenKind K2) const
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)
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...
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.
NamedDecl - This represents a decl with a name.
Declaration of a template function.
bool IsInsideALocalClassWithinATemplateFunction()
void startToken()
Reset all flags to cleared.
AttributeList - Represents a syntactic attribute.
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)