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,
56 HandleMemberFunctionDeclDelays(D, FnD);
71 ? diag::warn_cxx98_compat_defaulted_deleted_function
72 : diag::ext_defaulted_deleted_function)
76 if (
auto *DeclAsFunction = dyn_cast<FunctionDecl>(FnD)) {
77 DeclAsFunction->setRangeEnd(KWEndLoc);
81 ? diag::warn_cxx98_compat_defaulted_deleted_function
82 : diag::ext_defaulted_deleted_function)
85 if (
auto *DeclAsFunction = dyn_cast<FunctionDecl>(FnD)) {
86 DeclAsFunction->setRangeEnd(KWEndLoc);
89 llvm_unreachable(
"function definition after = not 'delete' or 'default'");
92 if (Tok.
is(tok::comma)) {
93 Diag(KWLoc, diag::err_default_delete_in_multiple_declaration)
96 }
else if (ExpectAndConsume(tok::semi, diag::err_expected_after,
97 Delete ?
"delete" :
"default")) {
105 trySkippingFunctionBody()) {
116 !(FnD && FnD->getAsFunction() &&
117 FnD->getAsFunction()->getReturnType()->getContainedAutoType()) &&
119 (TemplateInfo.Kind != ParsedTemplateInfo::NonTemplate &&
120 TemplateInfo.Kind != ParsedTemplateInfo::ExplicitSpecialization)) &&
124 LexTemplateFunctionForLateParsing(Toks);
137 LexedMethod* LM =
new LexedMethod(
this, FnD);
138 getCurrentClass().LateParsedDeclarations.push_back(LM);
145 if (ConsumeAndStoreFunctionPrologue(Toks)) {
152 delete getCurrentClass().LateParsedDeclarations.back();
153 getCurrentClass().LateParsedDeclarations.pop_back();
157 ConsumeAndStoreUntil(tok::r_brace, Toks,
false);
161 if (kind == tok::kw_try) {
162 while (Tok.
is(tok::kw_catch)) {
163 ConsumeAndStoreUntil(tok::l_brace, Toks,
false);
164 ConsumeAndStoreUntil(tok::r_brace, Toks,
false);
177 delete getCurrentClass().LateParsedDeclarations.back();
178 getCurrentClass().LateParsedDeclarations.pop_back();
188 void Parser::ParseCXXNonStaticMemberInitializer(
Decl *VarD) {
189 assert(Tok.
isOneOf(tok::l_brace, tok::equal) &&
190 "Current token not a '{' or '='!");
192 LateParsedMemberInitializer *MI =
193 new LateParsedMemberInitializer(
this, VarD);
194 getCurrentClass().LateParsedDeclarations.push_back(MI);
198 if (kind == tok::equal) {
203 if (kind == tok::l_brace) {
209 ConsumeAndStoreUntil(tok::r_brace, Toks,
true);
212 ConsumeAndStoreInitializer(Toks, CIK_DefaultInitializer);
225 Parser::LateParsedDeclaration::~LateParsedDeclaration() {}
226 void Parser::LateParsedDeclaration::ParseLexedMethodDeclarations() {}
227 void Parser::LateParsedDeclaration::ParseLexedMemberInitializers() {}
228 void Parser::LateParsedDeclaration::ParseLexedMethodDefs() {}
230 Parser::LateParsedClass::LateParsedClass(
Parser *
P, ParsingClass *
C)
231 : Self(P),
Class(C) {}
233 Parser::LateParsedClass::~LateParsedClass() {
234 Self->DeallocateParsedClasses(Class);
237 void Parser::LateParsedClass::ParseLexedMethodDeclarations() {
238 Self->ParseLexedMethodDeclarations(*Class);
241 void Parser::LateParsedClass::ParseLexedMemberInitializers() {
242 Self->ParseLexedMemberInitializers(*Class);
245 void Parser::LateParsedClass::ParseLexedMethodDefs() {
246 Self->ParseLexedMethodDefs(*Class);
249 void Parser::LateParsedMethodDeclaration::ParseLexedMethodDeclarations() {
250 Self->ParseLexedMethodDeclaration(*
this);
253 void Parser::LexedMethod::ParseLexedMethodDefs() {
254 Self->ParseLexedMethodDef(*
this);
257 void Parser::LateParsedMemberInitializer::ParseLexedMemberInitializers() {
258 Self->ParseLexedMemberInitializer(*
this);
265 void Parser::ParseLexedMethodDeclarations(ParsingClass &Class) {
266 bool HasTemplateScope = !Class.TopLevelClass && Class.TemplateScope;
269 TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);
270 if (HasTemplateScope) {
272 ++CurTemplateDepthTracker;
277 bool HasClassScope = !Class.TopLevelClass;
282 Class.TagOrTemplate);
284 for (
size_t i = 0; i < Class.LateParsedDeclarations.size(); ++i) {
285 Class.LateParsedDeclarations[i]->ParseLexedMethodDeclarations();
290 Class.TagOrTemplate);
293 void Parser::ParseLexedMethodDeclaration(LateParsedMethodDeclaration &LM) {
296 TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);
297 if (LM.TemplateScope) {
299 ++CurTemplateDepthTracker;
308 for (
unsigned I = 0, N = LM.DefaultArgs.size(); I != N; ++I) {
309 auto Param = cast<ParmVarDecl>(LM.DefaultArgs[I].Param);
311 bool HasUnparsed = Param->hasUnparsedDefaultArg();
313 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());
388 Token LastExceptionSpecToken = Toks->back();
389 Token ExceptionSpecEnd;
394 Toks->push_back(ExceptionSpecEnd);
397 Toks->push_back(Tok);
398 PP.EnterTokenStream(*Toks,
true);
411 = dyn_cast<FunctionTemplateDecl>(LM.Method))
412 Method = cast<CXXMethodDecl>(FunTmpl->getTemplatedDecl());
414 Method = cast<CXXMethodDecl>(LM.Method);
417 Method->getTypeQualifiers(),
428 = tryParseExceptionSpecification(
false, SpecificationRange,
430 DynamicExceptionRanges, NoexceptExpr,
431 ExceptionSpecTokens);
440 DynamicExceptionRanges,
442 NoexceptExpr.
get() :
nullptr);
454 LM.ExceptionSpecTokens =
nullptr;
457 PrototypeScope.Exit();
466 void Parser::ParseLexedMethodDefs(ParsingClass &Class) {
467 bool HasTemplateScope = !Class.TopLevelClass && Class.TemplateScope;
469 TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);
470 if (HasTemplateScope) {
472 ++CurTemplateDepthTracker;
474 bool HasClassScope = !Class.TopLevelClass;
478 for (
size_t i = 0; i < Class.LateParsedDeclarations.size(); ++i) {
479 Class.LateParsedDeclarations[i]->ParseLexedMethodDefs();
483 void Parser::ParseLexedMethodDef(LexedMethod &LM) {
486 TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);
487 if (LM.TemplateScope) {
489 ++CurTemplateDepthTracker;
492 assert(!LM.Toks.empty() &&
"Empty body!");
493 Token LastBodyToken = LM.Toks.back();
499 LM.Toks.push_back(BodyEnd);
502 LM.Toks.push_back(Tok);
503 PP.EnterTokenStream(LM.Toks,
true);
507 assert(Tok.
isOneOf(tok::l_brace, tok::colon, tok::kw_try)
508 &&
"Inline method not starting with '{', ':' or 'try'");
516 if (Tok.
is(tok::kw_try)) {
517 ParseFunctionTryBlock(LM.D, FnScope);
526 if (Tok.
is(tok::colon)) {
527 ParseConstructorInitializer(LM.D);
530 if (!Tok.
is(tok::l_brace)) {
545 !isa<FunctionTemplateDecl>(LM.D) ||
546 cast<FunctionTemplateDecl>(LM.D)->getTemplateParameters()->getDepth()
547 < TemplateParameterDepth) &&
548 "TemplateParameterDepth should be greater than the depth of " 549 "current template being instantiated!");
551 ParseFunctionStatementBody(LM.D, FnScope);
559 if (
auto *FD = dyn_cast_or_null<FunctionDecl>(LM.D))
560 if (isa<CXXMethodDecl>(FD) ||
568 void Parser::ParseLexedMemberInitializers(ParsingClass &Class) {
569 bool HasTemplateScope = !Class.TopLevelClass && Class.TemplateScope;
572 TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);
573 if (HasTemplateScope) {
575 ++CurTemplateDepthTracker;
578 bool AlreadyHasClassScope = Class.TopLevelClass;
580 ParseScope ClassScope(
this, ScopeFlags, !AlreadyHasClassScope);
581 ParseScopeFlags ClassScopeFlags(
this, ScopeFlags, AlreadyHasClassScope);
583 if (!AlreadyHasClassScope)
585 Class.TagOrTemplate);
587 if (!Class.LateParsedDeclarations.empty()) {
596 for (
size_t i = 0; i < Class.LateParsedDeclarations.size(); ++i) {
597 Class.LateParsedDeclarations[i]->ParseLexedMemberInitializers();
601 if (!AlreadyHasClassScope)
603 Class.TagOrTemplate);
608 void Parser::ParseLexedMemberInitializer(LateParsedMemberInitializer &MI) {
609 if (!MI.Field || MI.Field->isInvalidDecl())
614 MI.Toks.push_back(Tok);
615 PP.EnterTokenStream(MI.Toks,
true);
624 ExprResult Init = ParseCXXMemberInitializer(MI.Field,
false,
637 Diag(EndLoc, diag::err_expected_semi_decl_list);
660 bool isFirstTokenConsumed =
true;
663 if (Tok.
is(T1) || Tok.
is(T2)) {
664 if (ConsumeFinalToken) {
673 case tok::annot_module_begin:
674 case tok::annot_module_end:
675 case tok::annot_module_include:
683 ConsumeAndStoreUntil(tok::r_paren, Toks,
false);
689 ConsumeAndStoreUntil(tok::r_square, Toks,
false);
695 ConsumeAndStoreUntil(tok::r_brace, Toks,
false);
704 if (ParenCount && !isFirstTokenConsumed)
710 if (BracketCount && !isFirstTokenConsumed)
716 if (BraceCount && !isFirstTokenConsumed)
732 isFirstTokenConsumed =
false;
742 bool Parser::ConsumeAndStoreFunctionPrologue(
CachedTokens &Toks) {
743 if (Tok.
is(tok::kw_try)) {
748 if (Tok.
isNot(tok::colon)) {
754 ConsumeAndStoreUntil(tok::l_brace, tok::r_brace, Toks,
757 if (Tok.
isNot(tok::l_brace))
778 bool MightBeTemplateArgument =
false;
782 if (Tok.
is(tok::kw_decltype)) {
785 if (Tok.
isNot(tok::l_paren))
790 if (!ConsumeAndStoreUntil(tok::r_paren, Toks,
true)) {
792 Diag(OpenLoc, diag::note_matching) << tok::l_paren;
798 if (Tok.
is(tok::coloncolon)) {
802 if (Tok.
is(tok::kw_template)) {
808 if (Tok.
is(tok::identifier)) {
814 }
while (Tok.
is(tok::coloncolon));
816 if (Tok.
is(tok::code_completion)) {
818 ConsumeCodeCompletionToken();
819 if (Tok.
isOneOf(tok::identifier, tok::coloncolon, tok::kw_decltype)) {
826 if (Tok.
is(tok::comma)) {
832 if (Tok.
is(tok::less))
833 MightBeTemplateArgument =
true;
835 if (MightBeTemplateArgument) {
842 if (!ConsumeAndStoreUntil(tok::l_paren, tok::l_brace, Toks,
849 }
else if (Tok.
isNot(tok::l_paren) && Tok.
isNot(tok::l_brace)) {
853 << tok::l_paren << tok::l_brace;
860 bool IsLParen = (kind == tok::l_paren);
866 assert(kind == tok::l_brace &&
"Must be left paren or brace here.");
873 const Token &PreviousToken = Toks[Toks.size() - 2];
874 if (!MightBeTemplateArgument &&
875 !PreviousToken.
isOneOf(tok::identifier, tok::greater,
876 tok::greatergreater)) {
882 TentativeParsingAction PA(*
this);
884 !Tok.
isOneOf(tok::comma, tok::ellipsis, tok::l_brace)) {
897 tok::TokenKind CloseKind = IsLParen ? tok::r_paren : tok::r_brace;
898 if (!ConsumeAndStoreUntil(CloseKind, Toks,
true)) {
899 Diag(Tok, diag::err_expected) << CloseKind;
900 Diag(OpenLoc, diag::note_matching) <<
kind;
905 if (Tok.
is(tok::ellipsis)) {
912 if (Tok.
is(tok::comma)) {
915 }
else if (Tok.
is(tok::l_brace)) {
933 }
else if (!MightBeTemplateArgument) {
934 return Diag(Tok.
getLocation(), diag::err_expected_either) << tok::l_brace
942 bool Parser::ConsumeAndStoreConditional(
CachedTokens &Toks) {
944 assert(Tok.
is(tok::question));
948 while (Tok.
isNot(tok::colon)) {
949 if (!ConsumeAndStoreUntil(tok::question, tok::colon, Toks,
955 if (Tok.
is(tok::question) && !ConsumeAndStoreConditional(Toks))
970 : TentativeParsingAction(Self), Self(Self), EndKind(EndKind) {
973 TentativeParsingAction Inner(Self);
974 Self.ConsumeAndStoreUntil(EndKind, Toks,
true,
false);
984 auto Buffer = llvm::make_unique<Token[]>(Toks.size());
985 std::copy(Toks.begin() + 1, Toks.end(), Buffer.get());
986 Buffer[Toks.size() - 1] = Self.Tok;
987 Self.PP.EnterTokenStream(std::move(Buffer), Toks.size(),
true);
989 Self.Tok = Toks.front();
1005 bool Parser::ConsumeAndStoreInitializer(
CachedTokens &Toks,
1006 CachedInitKind CIK) {
1008 bool IsFirstToken =
true;
1013 unsigned AngleCount = 0;
1014 unsigned KnownTemplateCount = 0;
1017 switch (Tok.getKind()) {
1023 if (KnownTemplateCount)
1037 CIK == CIK_DefaultInitializer
1038 ? tok::semi : tok::r_paren);
1041 TPResult
Result = TPResult::Error;
1044 case CIK_DefaultInitializer:
1045 Result = TryParseInitDeclaratorList();
1048 if (Result == TPResult::Ambiguous && Tok.
isNot(tok::semi))
1049 Result = TPResult::False;
1052 case CIK_DefaultArgument:
1053 bool InvalidAsDeclaration =
false;
1054 Result = TryParseParameterDeclarationClause(
1055 &InvalidAsDeclaration,
true);
1058 if (Result == TPResult::Ambiguous && InvalidAsDeclaration)
1059 Result = TPResult::False;
1064 if (Result != TPResult::False && Result != TPResult::Error) {
1077 ++KnownTemplateCount;
1081 case tok::annot_module_begin:
1082 case tok::annot_module_end:
1083 case tok::annot_module_include:
1096 if (!ConsumeAndStoreConditional(Toks))
1100 case tok::greatergreatergreater:
1103 if (AngleCount) --AngleCount;
1104 if (KnownTemplateCount) --KnownTemplateCount;
1106 case tok::greatergreater:
1109 if (AngleCount) --AngleCount;
1110 if (KnownTemplateCount) --KnownTemplateCount;
1113 if (AngleCount) --AngleCount;
1114 if (KnownTemplateCount) --KnownTemplateCount;
1117 case tok::kw_template:
1121 Toks.push_back(Tok);
1123 if (Tok.
is(tok::identifier)) {
1124 Toks.push_back(Tok);
1126 if (Tok.
is(tok::less)) {
1128 ++KnownTemplateCount;
1129 Toks.push_back(Tok);
1135 case tok::kw_operator:
1138 Toks.push_back(Tok);
1140 switch (Tok.getKind()) {
1142 case tok::greatergreatergreater:
1143 case tok::greatergreater:
1146 Toks.push_back(Tok);
1156 Toks.push_back(Tok);
1158 ConsumeAndStoreUntil(tok::r_paren, Toks,
false);
1162 Toks.push_back(Tok);
1164 ConsumeAndStoreUntil(tok::r_square, Toks,
false);
1168 Toks.push_back(Tok);
1170 ConsumeAndStoreUntil(tok::r_brace, Toks,
false);
1180 if (CIK == CIK_DefaultArgument)
1182 if (ParenCount && !IsFirstToken)
1184 Toks.push_back(Tok);
1188 if (BracketCount && !IsFirstToken)
1190 Toks.push_back(Tok);
1194 if (BraceCount && !IsFirstToken)
1196 Toks.push_back(Tok);
1200 case tok::code_completion:
1201 Toks.push_back(Tok);
1202 ConsumeCodeCompletionToken();
1205 case tok::string_literal:
1206 case tok::wide_string_literal:
1207 case tok::utf8_string_literal:
1208 case tok::utf16_string_literal:
1209 case tok::utf32_string_literal:
1210 Toks.push_back(Tok);
1211 ConsumeStringToken();
1214 if (CIK == CIK_DefaultInitializer)
1219 Toks.push_back(Tok);
1223 IsFirstToken =
false;
void ActOnFinishDelayedMemberInitializers(Decl *Record)
An instance of this class is created to represent 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...
bool canSkipFunctionBody(Decl *D)
Determine whether we can skip parsing the body of a function definition, assuming we don't care about...
ParmVarDecl - 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
hasUnparsedDefaultArg - Determines whether this parameter has a default argument that has not yet bee...
SourceLocation ConsumeAnyToken(bool ConsumeCodeCompletionTok=false)
ConsumeAnyToken - Dispatch to the right Consume* method based on the current token type...
Decl * ActOnFinishFunctionBody(Decl *Decl, Stmt *Body)
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...
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
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.
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)
SourceLocation getEndLoc() const