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);
506 ConsumeAnyToken(
true);
507 assert(Tok.
isOneOf(tok::l_brace, tok::colon, tok::kw_try)
508 &&
"Inline method not starting with '{', ':' or 'try'");
515 if (Tok.
is(tok::kw_try)) {
516 ParseFunctionTryBlock(LM.D, FnScope);
525 if (Tok.
is(tok::colon)) {
526 ParseConstructorInitializer(LM.D);
529 if (!Tok.
is(tok::l_brace)) {
544 !isa<FunctionTemplateDecl>(LM.D) ||
545 cast<FunctionTemplateDecl>(LM.D)->getTemplateParameters()->getDepth()
546 < TemplateParameterDepth) &&
547 "TemplateParameterDepth should be greater than the depth of "
548 "current template being instantiated!");
550 ParseFunctionStatementBody(LM.D, FnScope);
558 if (
auto *FD = dyn_cast_or_null<FunctionDecl>(LM.D))
559 if (isa<CXXMethodDecl>(FD) ||
567 void Parser::ParseLexedMemberInitializers(ParsingClass &Class) {
568 bool HasTemplateScope = !Class.TopLevelClass && Class.TemplateScope;
571 TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);
572 if (HasTemplateScope) {
574 ++CurTemplateDepthTracker;
577 bool AlreadyHasClassScope = Class.TopLevelClass;
579 ParseScope ClassScope(
this, ScopeFlags, !AlreadyHasClassScope);
580 ParseScopeFlags ClassScopeFlags(
this, ScopeFlags, AlreadyHasClassScope);
582 if (!AlreadyHasClassScope)
584 Class.TagOrTemplate);
586 if (!Class.LateParsedDeclarations.empty()) {
595 for (
size_t i = 0; i < Class.LateParsedDeclarations.size(); ++i) {
596 Class.LateParsedDeclarations[i]->ParseLexedMemberInitializers();
600 if (!AlreadyHasClassScope)
602 Class.TagOrTemplate);
607 void Parser::ParseLexedMemberInitializer(LateParsedMemberInitializer &MI) {
608 if (!MI.Field || MI.Field->isInvalidDecl())
613 MI.Toks.push_back(Tok);
614 PP.EnterTokenStream(MI.Toks,
true);
617 ConsumeAnyToken(
true);
623 ExprResult Init = ParseCXXMemberInitializer(MI.Field,
false,
636 Diag(EndLoc, diag::err_expected_semi_decl_list);
656 bool StopAtSemi,
bool ConsumeFinalToken) {
659 bool isFirstTokenConsumed =
true;
662 if (Tok.
is(T1) || Tok.
is(T2)) {
663 if (ConsumeFinalToken) {
672 case tok::annot_module_begin:
673 case tok::annot_module_end:
674 case tok::annot_module_include:
682 ConsumeAndStoreUntil(tok::r_paren, Toks,
false);
688 ConsumeAndStoreUntil(tok::r_square, Toks,
false);
694 ConsumeAndStoreUntil(tok::r_brace, Toks,
false);
703 if (ParenCount && !isFirstTokenConsumed)
709 if (BracketCount && !isFirstTokenConsumed)
715 if (BraceCount && !isFirstTokenConsumed)
728 ConsumeAnyToken(
true);
731 isFirstTokenConsumed =
false;
741 bool Parser::ConsumeAndStoreFunctionPrologue(
CachedTokens &Toks) {
742 if (Tok.
is(tok::kw_try)) {
747 if (Tok.
isNot(tok::colon)) {
753 ConsumeAndStoreUntil(tok::l_brace, tok::r_brace, Toks,
756 if (Tok.
isNot(tok::l_brace))
777 bool MightBeTemplateArgument =
false;
781 if (Tok.
is(tok::kw_decltype)) {
784 if (Tok.
isNot(tok::l_paren))
789 if (!ConsumeAndStoreUntil(tok::r_paren, Toks,
true)) {
791 Diag(OpenLoc, diag::note_matching) << tok::l_paren;
797 if (Tok.
is(tok::coloncolon)) {
801 if (Tok.
is(tok::kw_template)) {
807 if (Tok.
is(tok::identifier)) {
813 }
while (Tok.
is(tok::coloncolon));
815 if (Tok.
is(tok::code_completion)) {
817 ConsumeCodeCompletionToken();
818 if (Tok.
isOneOf(tok::identifier, tok::coloncolon, tok::kw_decltype)) {
825 if (Tok.
is(tok::comma)) {
831 if (Tok.
is(tok::less))
832 MightBeTemplateArgument =
true;
834 if (MightBeTemplateArgument) {
841 if (!ConsumeAndStoreUntil(tok::l_paren, tok::l_brace, Toks,
848 }
else if (Tok.
isNot(tok::l_paren) && Tok.
isNot(tok::l_brace)) {
852 << tok::l_paren << tok::l_brace;
859 bool IsLParen = (kind == tok::l_paren);
865 assert(kind == tok::l_brace &&
"Must be left paren or brace here.");
873 if (!MightBeTemplateArgument &&
874 !PreviousToken.
isOneOf(tok::identifier, tok::greater,
875 tok::greatergreater)) {
881 TentativeParsingAction PA(*
this);
883 !Tok.
isOneOf(tok::comma, tok::ellipsis, tok::l_brace)) {
896 tok::TokenKind CloseKind = IsLParen ? tok::r_paren : tok::r_brace;
897 if (!ConsumeAndStoreUntil(CloseKind, Toks,
true)) {
898 Diag(Tok, diag::err_expected) << CloseKind;
899 Diag(OpenLoc, diag::note_matching) <<
kind;
904 if (Tok.
is(tok::ellipsis)) {
911 if (Tok.
is(tok::comma)) {
914 }
else if (Tok.
is(tok::l_brace)) {
932 }
else if (!MightBeTemplateArgument) {
933 return Diag(Tok.
getLocation(), diag::err_expected_either) << tok::l_brace
941 bool Parser::ConsumeAndStoreConditional(
CachedTokens &Toks) {
943 assert(Tok.
is(tok::question));
947 while (Tok.
isNot(tok::colon)) {
948 if (!ConsumeAndStoreUntil(tok::question, tok::colon, Toks,
954 if (Tok.
is(tok::question) && !ConsumeAndStoreConditional(Toks))
969 : TentativeParsingAction(Self), Self(Self), EndKind(EndKind) {
972 TentativeParsingAction Inner(Self);
973 Self.ConsumeAndStoreUntil(EndKind, Toks,
true,
false);
983 auto Buffer = llvm::make_unique<Token[]>(Toks.size());
984 std::copy(Toks.begin() + 1, Toks.end(),
Buffer.get());
985 Buffer[Toks.size() - 1] = Self.Tok;
986 Self.PP.EnterTokenStream(std::move(Buffer), Toks.size(),
true);
988 Self.Tok = Toks.front();
1004 bool Parser::ConsumeAndStoreInitializer(
CachedTokens &Toks,
1005 CachedInitKind CIK) {
1007 bool IsFirstToken =
true;
1012 unsigned AngleCount = 0;
1013 unsigned KnownTemplateCount = 0;
1022 if (KnownTemplateCount)
1035 UnannotatedTentativeParsingAction PA(*
this,
1036 CIK == CIK_DefaultInitializer
1037 ? tok::semi : tok::r_paren);
1043 case CIK_DefaultInitializer:
1044 Result = TryParseInitDeclaratorList();
1051 case CIK_DefaultArgument:
1052 bool InvalidAsDeclaration =
false;
1053 Result = TryParseParameterDeclarationClause(
1054 &InvalidAsDeclaration,
true);
1072 PA.RevertAnnotations();
1076 ++KnownTemplateCount;
1080 case tok::annot_module_begin:
1081 case tok::annot_module_end:
1082 case tok::annot_module_include:
1095 if (!ConsumeAndStoreConditional(Toks))
1099 case tok::greatergreatergreater:
1102 if (AngleCount) --AngleCount;
1103 if (KnownTemplateCount) --KnownTemplateCount;
1105 case tok::greatergreater:
1108 if (AngleCount) --AngleCount;
1109 if (KnownTemplateCount) --KnownTemplateCount;
1112 if (AngleCount) --AngleCount;
1113 if (KnownTemplateCount) --KnownTemplateCount;
1116 case tok::kw_template:
1120 Toks.push_back(Tok);
1122 if (Tok.
is(tok::identifier)) {
1123 Toks.push_back(Tok);
1125 if (Tok.
is(tok::less)) {
1127 ++KnownTemplateCount;
1128 Toks.push_back(Tok);
1134 case tok::kw_operator:
1137 Toks.push_back(Tok);
1141 case tok::greatergreatergreater:
1142 case tok::greatergreater:
1145 Toks.push_back(Tok);
1155 Toks.push_back(Tok);
1157 ConsumeAndStoreUntil(tok::r_paren, Toks,
false);
1161 Toks.push_back(Tok);
1163 ConsumeAndStoreUntil(tok::r_square, Toks,
false);
1167 Toks.push_back(Tok);
1169 ConsumeAndStoreUntil(tok::r_brace, Toks,
false);
1179 if (CIK == CIK_DefaultArgument)
1181 if (ParenCount && !IsFirstToken)
1183 Toks.push_back(Tok);
1187 if (BracketCount && !IsFirstToken)
1189 Toks.push_back(Tok);
1193 if (BraceCount && !IsFirstToken)
1195 Toks.push_back(Tok);
1199 case tok::code_completion:
1200 Toks.push_back(Tok);
1201 ConsumeCodeCompletionToken();
1204 case tok::string_literal:
1205 case tok::wide_string_literal:
1206 case tok::utf8_string_literal:
1207 case tok::utf16_string_literal:
1208 case tok::utf32_string_literal:
1209 Toks.push_back(Tok);
1210 ConsumeStringToken();
1213 if (CIK == CIK_DefaultInitializer)
1218 Toks.push_back(Tok);
1222 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...
bool canSkipFunctionBody(Decl *D)
Determine whether we can skip parsing the body of a function definition, assuming we don't care about...
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)
bool isInIdentifierNamespace(unsigned NS) const
This declaration is a friend function.
Token - This structure provides full information about a lexed token.
void setKind(tok::TokenKind K)
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.
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)
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)
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.
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)
Decl * ActOnSkippedFunctionBody(Decl *Decl)
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
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)) {...
void ActOnFinishInlineFunctionDef(FunctionDecl *D)
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.
void setWillHaveBody(bool V=true)
FormatToken * PreviousToken
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)
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)