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);
186 delete getCurrentClass().LateParsedDeclarations.back();
187 getCurrentClass().LateParsedDeclarations.pop_back();
197 void Parser::ParseCXXNonStaticMemberInitializer(
Decl *VarD) {
198 assert(Tok.
isOneOf(tok::l_brace, tok::equal) &&
199 "Current token not a '{' or '='!");
201 LateParsedMemberInitializer *MI =
202 new LateParsedMemberInitializer(
this, VarD);
203 getCurrentClass().LateParsedDeclarations.push_back(MI);
207 if (kind == tok::equal) {
212 if (kind == tok::l_brace) {
218 ConsumeAndStoreUntil(tok::r_brace, Toks,
true);
221 ConsumeAndStoreInitializer(Toks, CIK_DefaultInitializer);
234 Parser::LateParsedDeclaration::~LateParsedDeclaration() {}
235 void Parser::LateParsedDeclaration::ParseLexedMethodDeclarations() {}
236 void Parser::LateParsedDeclaration::ParseLexedMemberInitializers() {}
237 void Parser::LateParsedDeclaration::ParseLexedMethodDefs() {}
239 Parser::LateParsedClass::LateParsedClass(
Parser *
P, ParsingClass *
C)
240 : Self(P),
Class(C) {}
242 Parser::LateParsedClass::~LateParsedClass() {
243 Self->DeallocateParsedClasses(Class);
246 void Parser::LateParsedClass::ParseLexedMethodDeclarations() {
247 Self->ParseLexedMethodDeclarations(*Class);
250 void Parser::LateParsedClass::ParseLexedMemberInitializers() {
251 Self->ParseLexedMemberInitializers(*Class);
254 void Parser::LateParsedClass::ParseLexedMethodDefs() {
255 Self->ParseLexedMethodDefs(*Class);
258 void Parser::LateParsedMethodDeclaration::ParseLexedMethodDeclarations() {
259 Self->ParseLexedMethodDeclaration(*
this);
262 void Parser::LexedMethod::ParseLexedMethodDefs() {
263 Self->ParseLexedMethodDef(*
this);
266 void Parser::LateParsedMemberInitializer::ParseLexedMemberInitializers() {
267 Self->ParseLexedMemberInitializer(*
this);
274 void Parser::ParseLexedMethodDeclarations(ParsingClass &Class) {
275 bool HasTemplateScope = !Class.TopLevelClass && Class.TemplateScope;
278 TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);
279 if (HasTemplateScope) {
281 ++CurTemplateDepthTracker;
286 bool HasClassScope = !Class.TopLevelClass;
291 Class.TagOrTemplate);
293 for (
size_t i = 0; i < Class.LateParsedDeclarations.size(); ++i) {
294 Class.LateParsedDeclarations[i]->ParseLexedMethodDeclarations();
299 Class.TagOrTemplate);
302 void Parser::ParseLexedMethodDeclaration(LateParsedMethodDeclaration &LM) {
305 TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);
306 if (LM.TemplateScope) {
308 ++CurTemplateDepthTracker;
317 for (
unsigned I = 0, N = LM.DefaultArgs.size();
I != N; ++
I) {
318 auto Param = cast<ParmVarDecl>(LM.DefaultArgs[
I].Param);
320 bool HasUnparsed = Param->hasUnparsedDefaultArg();
325 Token LastDefaultArgToken = Toks->back();
331 Toks->push_back(DefArgEnd);
334 Toks->push_back(Tok);
335 PP.EnterTokenStream(*Toks,
true);
341 assert(Tok.
is(tok::equal) &&
"Default argument not starting with '='");
352 Diag(Tok, diag::warn_cxx98_compat_generalized_initializer_lists);
353 DefArgResult = ParseBraceInitializer();
364 assert(Toks->size() >= 3 &&
"expected a token in default arg");
367 (*Toks)[Toks->size() - 3].getLocation());
382 LM.DefaultArgs[
I].Toks =
nullptr;
383 }
else if (HasUnparsed) {
384 assert(Param->hasInheritedDefaultArg());
385 FunctionDecl *Old = cast<FunctionDecl>(LM.Method)->getPreviousDecl();
392 Param->setDefaultArg(OldParam->
getInit());
399 Token LastExceptionSpecToken = Toks->back();
400 Token ExceptionSpecEnd;
405 Toks->push_back(ExceptionSpecEnd);
408 Toks->push_back(Tok);
409 PP.EnterTokenStream(*Toks,
true);
422 = dyn_cast<FunctionTemplateDecl>(LM.Method))
423 Method = cast<CXXMethodDecl>(FunTmpl->getTemplatedDecl());
425 Method = cast<CXXMethodDecl>(LM.Method);
428 Method->getTypeQualifiers(),
439 = tryParseExceptionSpecification(
false, SpecificationRange,
441 DynamicExceptionRanges, NoexceptExpr,
442 ExceptionSpecTokens);
451 DynamicExceptionRanges,
453 NoexceptExpr.
get() :
nullptr);
465 LM.ExceptionSpecTokens =
nullptr;
468 PrototypeScope.Exit();
477 void Parser::ParseLexedMethodDefs(ParsingClass &Class) {
478 bool HasTemplateScope = !Class.TopLevelClass && Class.TemplateScope;
480 TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);
481 if (HasTemplateScope) {
483 ++CurTemplateDepthTracker;
485 bool HasClassScope = !Class.TopLevelClass;
489 for (
size_t i = 0; i < Class.LateParsedDeclarations.size(); ++i) {
490 Class.LateParsedDeclarations[i]->ParseLexedMethodDefs();
494 void Parser::ParseLexedMethodDef(LexedMethod &LM) {
497 TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);
498 if (LM.TemplateScope) {
500 ++CurTemplateDepthTracker;
503 assert(!LM.Toks.empty() &&
"Empty body!");
504 Token LastBodyToken = LM.Toks.back();
510 LM.Toks.push_back(BodyEnd);
513 LM.Toks.push_back(Tok);
514 PP.EnterTokenStream(LM.Toks,
true);
517 ConsumeAnyToken(
true);
518 assert(Tok.
isOneOf(tok::l_brace, tok::colon, tok::kw_try)
519 &&
"Inline method not starting with '{', ':' or 'try'");
526 if (Tok.
is(tok::kw_try)) {
527 ParseFunctionTryBlock(LM.D, FnScope);
536 if (Tok.
is(tok::colon)) {
537 ParseConstructorInitializer(LM.D);
540 if (!Tok.
is(tok::l_brace)) {
555 !isa<FunctionTemplateDecl>(LM.D) ||
556 cast<FunctionTemplateDecl>(LM.D)->getTemplateParameters()->getDepth()
557 < TemplateParameterDepth) &&
558 "TemplateParameterDepth should be greater than the depth of "
559 "current template being instantiated!");
561 ParseFunctionStatementBody(LM.D, FnScope);
565 LM.D->getAsFunction()->setLateTemplateParsed(
false);
573 if (
auto *FD = dyn_cast_or_null<FunctionDecl>(LM.D))
574 if (isa<CXXMethodDecl>(FD) ||
575 FD->isInIdentifierNamespace(Decl::IDNS_OrdinaryFriend))
582 void Parser::ParseLexedMemberInitializers(ParsingClass &Class) {
583 bool HasTemplateScope = !Class.TopLevelClass && Class.TemplateScope;
586 TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);
587 if (HasTemplateScope) {
589 ++CurTemplateDepthTracker;
592 bool AlreadyHasClassScope = Class.TopLevelClass;
594 ParseScope ClassScope(
this, ScopeFlags, !AlreadyHasClassScope);
595 ParseScopeFlags ClassScopeFlags(
this, ScopeFlags, AlreadyHasClassScope);
597 if (!AlreadyHasClassScope)
599 Class.TagOrTemplate);
601 if (!Class.LateParsedDeclarations.empty()) {
610 for (
size_t i = 0; i < Class.LateParsedDeclarations.size(); ++i) {
611 Class.LateParsedDeclarations[i]->ParseLexedMemberInitializers();
615 if (!AlreadyHasClassScope)
617 Class.TagOrTemplate);
622 void Parser::ParseLexedMemberInitializer(LateParsedMemberInitializer &MI) {
623 if (!MI.Field || MI.Field->isInvalidDecl())
628 MI.Toks.push_back(Tok);
629 PP.EnterTokenStream(MI.Toks,
true);
632 ConsumeAnyToken(
true);
638 ExprResult Init = ParseCXXMemberInitializer(MI.Field,
false,
651 Diag(EndLoc, diag::err_expected_semi_decl_list);
671 bool StopAtSemi,
bool ConsumeFinalToken) {
674 bool isFirstTokenConsumed =
true;
677 if (Tok.
is(T1) || Tok.
is(T2)) {
678 if (ConsumeFinalToken) {
687 case tok::annot_module_begin:
688 case tok::annot_module_end:
689 case tok::annot_module_include:
697 ConsumeAndStoreUntil(tok::r_paren, Toks,
false);
703 ConsumeAndStoreUntil(tok::r_square, Toks,
false);
709 ConsumeAndStoreUntil(tok::r_brace, Toks,
false);
718 if (ParenCount && !isFirstTokenConsumed)
724 if (BracketCount && !isFirstTokenConsumed)
730 if (BraceCount && !isFirstTokenConsumed)
736 case tok::code_completion:
738 ConsumeCodeCompletionToken();
741 case tok::string_literal:
742 case tok::wide_string_literal:
743 case tok::utf8_string_literal:
744 case tok::utf16_string_literal:
745 case tok::utf32_string_literal:
747 ConsumeStringToken();
759 isFirstTokenConsumed =
false;
769 bool Parser::ConsumeAndStoreFunctionPrologue(
CachedTokens &Toks) {
770 if (Tok.
is(tok::kw_try)) {
775 if (Tok.
isNot(tok::colon)) {
781 ConsumeAndStoreUntil(tok::l_brace, tok::r_brace, Toks,
784 if (Tok.
isNot(tok::l_brace))
805 bool MightBeTemplateArgument =
false;
809 if (Tok.
is(tok::kw_decltype)) {
812 if (Tok.
isNot(tok::l_paren))
817 if (!ConsumeAndStoreUntil(tok::r_paren, Toks,
true)) {
819 Diag(OpenLoc, diag::note_matching) << tok::l_paren;
825 if (Tok.
is(tok::coloncolon)) {
829 if (Tok.
is(tok::kw_template)) {
835 if (Tok.
isOneOf(tok::identifier, tok::kw_template)) {
838 }
else if (Tok.
is(tok::code_completion)) {
840 ConsumeCodeCompletionToken();
844 MightBeTemplateArgument =
true;
849 }
while (Tok.
is(tok::coloncolon));
851 if (Tok.
is(tok::less))
852 MightBeTemplateArgument =
true;
854 if (MightBeTemplateArgument) {
861 if (!ConsumeAndStoreUntil(tok::l_paren, tok::l_brace, Toks,
868 }
else if (Tok.
isNot(tok::l_paren) && Tok.
isNot(tok::l_brace)) {
872 << tok::l_paren << tok::l_brace;
879 bool IsLParen = (kind == tok::l_paren);
885 assert(kind == tok::l_brace &&
"Must be left paren or brace here.");
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...
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)
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.
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)
Decl * ActOnSkippedFunctionBody(Decl *Decl)
void ActOnStartCXXInClassMemberInitializer()
Enter a new C++ default initializer scope.
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.
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)