19 using namespace clang;
24 NamedDecl *Parser::ParseCXXInlineMethodDef(
29 assert(Tok.
isOneOf(tok::l_brace, tok::colon, tok::kw_try, tok::equal) &&
30 "Current token not a '{', ':', '=', or 'try'!");
33 TemplateInfo.TemplateParams ? TemplateInfo.TemplateParams->data()
35 TemplateInfo.TemplateParams ? TemplateInfo.TemplateParams->size() : 0);
43 TemplateParams,
nullptr,
53 HandleMemberFunctionDeclDelays(D, FnD);
68 ? diag::warn_cxx98_compat_defaulted_deleted_function
69 : diag::ext_defaulted_deleted_function)
73 if (
auto *DeclAsFunction = dyn_cast<FunctionDecl>(FnD)) {
74 DeclAsFunction->setRangeEnd(KWEndLoc);
78 ? diag::warn_cxx98_compat_defaulted_deleted_function
79 : diag::ext_defaulted_deleted_function)
82 if (
auto *DeclAsFunction = dyn_cast<FunctionDecl>(FnD)) {
83 DeclAsFunction->setRangeEnd(KWEndLoc);
86 llvm_unreachable(
"function definition after = not 'delete' or 'default'");
89 if (Tok.
is(tok::comma)) {
90 Diag(KWLoc, diag::err_default_delete_in_multiple_declaration)
93 }
else if (ExpectAndConsume(tok::semi, diag::err_expected_after,
94 Delete ?
"delete" :
"default")) {
102 trySkippingFunctionBody()) {
113 !(FnD && FnD->getAsFunction() &&
114 FnD->getAsFunction()->getReturnType()->getContainedAutoType()) &&
116 (TemplateInfo.Kind != ParsedTemplateInfo::NonTemplate &&
117 TemplateInfo.Kind != ParsedTemplateInfo::ExplicitSpecialization)) &&
121 LexTemplateFunctionForLateParsing(Toks);
134 LexedMethod* LM =
new LexedMethod(
this, FnD);
135 getCurrentClass().LateParsedDeclarations.push_back(LM);
142 if (ConsumeAndStoreFunctionPrologue(Toks)) {
149 delete getCurrentClass().LateParsedDeclarations.back();
150 getCurrentClass().LateParsedDeclarations.pop_back();
154 ConsumeAndStoreUntil(tok::r_brace, Toks,
false);
158 if (kind == tok::kw_try) {
159 while (Tok.
is(tok::kw_catch)) {
160 ConsumeAndStoreUntil(tok::l_brace, Toks,
false);
161 ConsumeAndStoreUntil(tok::r_brace, Toks,
false);
174 delete getCurrentClass().LateParsedDeclarations.back();
175 getCurrentClass().LateParsedDeclarations.pop_back();
185 void Parser::ParseCXXNonStaticMemberInitializer(
Decl *VarD) {
186 assert(Tok.
isOneOf(tok::l_brace, tok::equal) &&
187 "Current token not a '{' or '='!");
189 LateParsedMemberInitializer *MI =
190 new LateParsedMemberInitializer(
this, VarD);
191 getCurrentClass().LateParsedDeclarations.push_back(MI);
195 if (kind == tok::equal) {
200 if (kind == tok::l_brace) {
206 ConsumeAndStoreUntil(tok::r_brace, Toks,
true);
209 ConsumeAndStoreInitializer(Toks, CIK_DefaultInitializer);
222 Parser::LateParsedDeclaration::~LateParsedDeclaration() {}
223 void Parser::LateParsedDeclaration::ParseLexedMethodDeclarations() {}
224 void Parser::LateParsedDeclaration::ParseLexedMemberInitializers() {}
225 void Parser::LateParsedDeclaration::ParseLexedMethodDefs() {}
227 Parser::LateParsedClass::LateParsedClass(
Parser *
P, ParsingClass *
C)
228 : Self(P),
Class(C) {}
230 Parser::LateParsedClass::~LateParsedClass() {
231 Self->DeallocateParsedClasses(Class);
234 void Parser::LateParsedClass::ParseLexedMethodDeclarations() {
235 Self->ParseLexedMethodDeclarations(*Class);
238 void Parser::LateParsedClass::ParseLexedMemberInitializers() {
239 Self->ParseLexedMemberInitializers(*Class);
242 void Parser::LateParsedClass::ParseLexedMethodDefs() {
243 Self->ParseLexedMethodDefs(*Class);
246 void Parser::LateParsedMethodDeclaration::ParseLexedMethodDeclarations() {
247 Self->ParseLexedMethodDeclaration(*
this);
250 void Parser::LexedMethod::ParseLexedMethodDefs() {
251 Self->ParseLexedMethodDef(*
this);
254 void Parser::LateParsedMemberInitializer::ParseLexedMemberInitializers() {
255 Self->ParseLexedMemberInitializer(*
this);
262 void Parser::ParseLexedMethodDeclarations(ParsingClass &Class) {
263 bool HasTemplateScope = !Class.TopLevelClass && Class.TemplateScope;
266 TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);
267 if (HasTemplateScope) {
269 ++CurTemplateDepthTracker;
274 bool HasClassScope = !Class.TopLevelClass;
279 Class.TagOrTemplate);
281 for (
size_t i = 0;
i < Class.LateParsedDeclarations.size(); ++
i) {
282 Class.LateParsedDeclarations[
i]->ParseLexedMethodDeclarations();
287 Class.TagOrTemplate);
290 void Parser::ParseLexedMethodDeclaration(LateParsedMethodDeclaration &LM) {
293 TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);
294 if (LM.TemplateScope) {
296 ++CurTemplateDepthTracker;
305 for (
unsigned I = 0, N = LM.DefaultArgs.size(); I != N; ++I) {
306 auto Param = cast<ParmVarDecl>(LM.DefaultArgs[I].Param);
308 bool HasUnparsed = Param->hasUnparsedDefaultArg();
310 std::unique_ptr<CachedTokens> Toks = std::move(LM.DefaultArgs[I].Toks);
316 Token LastDefaultArgToken = Toks->back();
322 Toks->push_back(DefArgEnd);
325 Toks->push_back(Tok);
326 PP.EnterTokenStream(*Toks,
true,
true);
332 assert(Tok.
is(tok::equal) &&
"Default argument not starting with '='");
343 Diag(Tok, diag::warn_cxx98_compat_generalized_initializer_lists);
344 DefArgResult = ParseBraceInitializer();
355 assert(Toks->size() >= 3 &&
"expected a token in default arg");
358 (*Toks)[Toks->size() - 3].getLocation());
371 }
else if (HasUnparsed) {
372 assert(Param->hasInheritedDefaultArg());
373 FunctionDecl *Old = cast<FunctionDecl>(LM.Method)->getPreviousDecl();
380 Param->setDefaultArg(OldParam->
getInit());
389 Token LastExceptionSpecToken = Toks->back();
390 Token ExceptionSpecEnd;
395 Toks->push_back(ExceptionSpecEnd);
398 Toks->push_back(Tok);
399 PP.EnterTokenStream(*Toks,
true,
true);
412 = dyn_cast<FunctionTemplateDecl>(LM.Method))
413 Method = cast<CXXMethodDecl>(FunTmpl->getTemplatedDecl());
415 Method = cast<CXXMethodDecl>(LM.Method);
418 Method->getMethodQualifiers(),
429 = tryParseExceptionSpecification(
false, SpecificationRange,
431 DynamicExceptionRanges, NoexceptExpr,
432 ExceptionSpecTokens);
441 DynamicExceptionRanges,
443 NoexceptExpr.
get() :
nullptr);
455 LM.ExceptionSpecTokens =
nullptr;
458 PrototypeScope.Exit();
467 void Parser::ParseLexedMethodDefs(ParsingClass &Class) {
468 bool HasTemplateScope = !Class.TopLevelClass && Class.TemplateScope;
470 TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);
471 if (HasTemplateScope) {
473 ++CurTemplateDepthTracker;
475 bool HasClassScope = !Class.TopLevelClass;
479 for (
size_t i = 0;
i < Class.LateParsedDeclarations.size(); ++
i) {
480 Class.LateParsedDeclarations[
i]->ParseLexedMethodDefs();
484 void Parser::ParseLexedMethodDef(LexedMethod &LM) {
487 TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);
488 if (LM.TemplateScope) {
490 ++CurTemplateDepthTracker;
495 assert(!LM.Toks.empty() &&
"Empty body!");
496 Token LastBodyToken = LM.Toks.back();
502 LM.Toks.push_back(BodyEnd);
505 LM.Toks.push_back(Tok);
506 PP.EnterTokenStream(LM.Toks,
true,
true);
510 assert(Tok.
isOneOf(tok::l_brace, tok::colon, tok::kw_try)
511 &&
"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);
562 if (
auto *FD = dyn_cast_or_null<FunctionDecl>(LM.D))
563 if (isa<CXXMethodDecl>(FD) ||
571 void Parser::ParseLexedMemberInitializers(ParsingClass &Class) {
572 bool HasTemplateScope = !Class.TopLevelClass && Class.TemplateScope;
575 TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);
576 if (HasTemplateScope) {
578 ++CurTemplateDepthTracker;
581 bool AlreadyHasClassScope = Class.TopLevelClass;
583 ParseScope ClassScope(
this, ScopeFlags, !AlreadyHasClassScope);
584 ParseScopeFlags ClassScopeFlags(
this, ScopeFlags, AlreadyHasClassScope);
586 if (!AlreadyHasClassScope)
588 Class.TagOrTemplate);
590 if (!Class.LateParsedDeclarations.empty()) {
599 for (
size_t i = 0;
i < Class.LateParsedDeclarations.size(); ++
i) {
600 Class.LateParsedDeclarations[
i]->ParseLexedMemberInitializers();
604 if (!AlreadyHasClassScope)
606 Class.TagOrTemplate);
611 void Parser::ParseLexedMemberInitializer(LateParsedMemberInitializer &MI) {
612 if (!MI.Field || MI.Field->isInvalidDecl())
619 MI.Toks.push_back(Tok);
620 PP.EnterTokenStream(MI.Toks,
true,
true);
629 ExprResult Init = ParseCXXMemberInitializer(MI.Field,
false,
642 Diag(EndLoc, diag::err_expected_semi_decl_list);
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)
737 isFirstTokenConsumed =
false;
747 bool Parser::ConsumeAndStoreFunctionPrologue(
CachedTokens &Toks) {
748 if (Tok.
is(tok::kw_try)) {
753 if (Tok.
isNot(tok::colon)) {
759 ConsumeAndStoreUntil(tok::l_brace, tok::r_brace, Toks,
762 if (Tok.
isNot(tok::l_brace))
783 bool MightBeTemplateArgument =
false;
787 if (Tok.
is(tok::kw_decltype)) {
790 if (Tok.
isNot(tok::l_paren))
795 if (!ConsumeAndStoreUntil(tok::r_paren, Toks,
true)) {
797 Diag(OpenLoc, diag::note_matching) << tok::l_paren;
803 if (Tok.
is(tok::coloncolon)) {
807 if (Tok.
is(tok::kw_template)) {
813 if (Tok.
is(tok::identifier)) {
819 }
while (Tok.
is(tok::coloncolon));
821 if (Tok.
is(tok::code_completion)) {
823 ConsumeCodeCompletionToken();
824 if (Tok.
isOneOf(tok::identifier, tok::coloncolon, tok::kw_decltype)) {
831 if (Tok.
is(tok::comma)) {
837 if (Tok.
is(tok::less))
838 MightBeTemplateArgument =
true;
840 if (MightBeTemplateArgument) {
847 if (!ConsumeAndStoreUntil(tok::l_paren, tok::l_brace, Toks,
854 }
else if (Tok.
isNot(tok::l_paren) && Tok.
isNot(tok::l_brace)) {
858 << tok::l_paren << tok::l_brace;
865 bool IsLParen = (kind == tok::l_paren);
871 assert(kind == tok::l_brace &&
"Must be left paren or brace here.");
878 const Token &PreviousToken = Toks[Toks.size() - 2];
879 if (!MightBeTemplateArgument &&
880 !PreviousToken.
isOneOf(tok::identifier, tok::greater,
881 tok::greatergreater)) {
887 TentativeParsingAction PA(*
this);
889 !Tok.
isOneOf(tok::comma, tok::ellipsis, tok::l_brace)) {
902 tok::TokenKind CloseKind = IsLParen ? tok::r_paren : tok::r_brace;
903 if (!ConsumeAndStoreUntil(CloseKind, Toks,
true)) {
904 Diag(Tok, diag::err_expected) << CloseKind;
905 Diag(OpenLoc, diag::note_matching) <<
kind;
910 if (Tok.
is(tok::ellipsis)) {
917 if (Tok.
is(tok::comma)) {
920 }
else if (Tok.
is(tok::l_brace)) {
938 }
else if (!MightBeTemplateArgument) {
939 return Diag(Tok.
getLocation(), diag::err_expected_either) << tok::l_brace
947 bool Parser::ConsumeAndStoreConditional(
CachedTokens &Toks) {
949 assert(Tok.
is(tok::question));
953 while (Tok.
isNot(tok::colon)) {
954 if (!ConsumeAndStoreUntil(tok::question, tok::colon, Toks,
960 if (Tok.
is(tok::question) && !ConsumeAndStoreConditional(Toks))
975 : TentativeParsingAction(Self), Self(Self), EndKind(EndKind) {
978 TentativeParsingAction Inner(Self);
979 Self.ConsumeAndStoreUntil(EndKind, Toks,
true,
false);
989 auto Buffer = llvm::make_unique<Token[]>(Toks.size());
990 std::copy(Toks.begin() + 1, Toks.end(), Buffer.get());
991 Buffer[Toks.size() - 1] = Self.Tok;
992 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.
void ProcessDeclAttributeList(Scope *S, Decl *D, const ParsedAttributesView &AL, bool IncludeCXX11Attributes=true)
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 ...
The collection of all-type qualifiers we support.
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
bool hasConstexprSpecifier() 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. ...
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.
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