# HG changeset patch # User anatofuz # Date 1584603328 -32400 # Node ID c936242a6e27062381042d2c036545d580282c99 # Parent dbfec6499728225768ae2b95605189c630149515 fix arguments at DeclaratorChunk::getFunction diff -r dbfec6499728 -r c936242a6e27 clang/lib/Parse/ParseCbC.cpp --- a/clang/lib/Parse/ParseCbC.cpp Wed Mar 18 19:11:03 2020 +0900 +++ b/clang/lib/Parse/ParseCbC.cpp Thu Mar 19 16:35:28 2020 +0900 @@ -293,8 +293,8 @@ LHSToken.setLocation(Loc); LHSToken.setIdentifierInfo(LHSII); LHSToken.setKind(tok::annot_primary_expr); - StatementFilterCCC Validator(Next); - Sema::NameClassification Classification = Actions.ClassifyName(getCurScope(), SS, LHSII, Loc, Next, SS.isEmpty() ? Validator : 0); + ExternalSpace::StatementFilterCCC Validator(Next); + Sema::NameClassification Classification = Actions.ClassifyName(getCurScope(), SS, LHSII, Loc, Next, SS.isEmpty() ? &Validator : nullptr); setExprAnnotation(LHSToken, Classification.getExpression()); LHSToken.setAnnotationEndLoc(Loc); PP.AnnotateCachedTokens(LHSToken); @@ -370,14 +370,14 @@ ParamInfo.push_back(DeclaratorChunk::ParamInfo(0, Loc, Param, 0)); HasProto = true; - D.AddTypeInfo(DeclaratorChunk::getFunction(HasProto, false, Loc, ParamInfo.data(), - ParamInfo.size(), EllipsisLoc, Loc, FPDS.getTypeQualifiers(), - RefQualifierIsLValueRef, RefQualifierLoc, ConstQualifierLoc, - VolatileQualifierLoc, RefQualifierLoc, SourceLocation(), + D.AddTypeInfo(DeclaratorChunk::getFunction(HasProto, ESpecType, Loc, ParamInfo.data(), + ParamInfo.size(), EllipsisLoc, Loc, + RefQualifierIsLValueRef, RefQualifierLoc, + /*MutableLoc=*/SourceLocation(), ESpecType, ESpecRange.getBegin(), DynamicExceptions.data(), DynamicExceptionRanges.data(), DynamicExceptions.size(), - NoexceptExpr.isUsable() ? NoexceptExpr.get() : 0, ExceptionSpecTokens, None, Loc, Loc, D, TrailingReturnType), + NoexceptExpr.isUsable() ? NoexceptExpr.get() : 0, ExceptionSpecTokens, None, Loc, Loc, D, TrailingReturnType,&FPDS), std::move(FnAttrs), Loc); PrototypeScope.Exit(); DSp = &FDS; @@ -514,9 +514,9 @@ UnqualifiedId Name; CXXScopeSpec SS; SourceLocation TemplateKWLoc; - StatementFilterCCC Validator(Next); + ExternalSpace::CastExpressionIdValidator Validator(false,true); Name.setIdentifier(II, Loc); - return Actions.ActOnIdExpression(getCurScope(), SS, TemplateKWLoc, Name, false, IsAddressOfOperand, Validator); + return Actions.ActOnIdExpression(getCurScope(), SS, TemplateKWLoc, Name, false, IsAddressOfOperand, &Validator); } /// LookupMemberAndBuildExpr - Look up member name, create ExprResult and return it. @@ -572,7 +572,7 @@ SourceLocation(), false, clang::TypeResult(), false, false); Decl *TagDecl = TagOrTempResult.get(); - PrettyDeclStackTraceEntry CrashInfo(Actions, TagDecl, Loc, "parsing struct/union body"); + PrettyDeclStackTraceEntry CrashInfo(Actions.Context, TagDecl, Loc, "parsing struct/union body"); ParseScope StructScope(this, Scope::ClassScope|Scope::DeclScope); Actions.ActOnTagStartDefinition(getCurScope(), TagDecl); SmallVector FieldDecls; @@ -701,12 +701,12 @@ ParamInfo.push_back(DeclaratorChunk::ParamInfo(envII, Loc, Param, 0)); D.AddTypeInfo(DeclaratorChunk::getFunction(HasProto, IsAmbiguous, Loc, ParamInfo.data(), ParamInfo.size(), EllipsisLoc, Loc, - FDS.getTypeQualifiers(), RefQualifierIsLValueRef, RefQualifierLoc, ConstQualifierLoc, - VolatileQualifierLoc, RestrictQualifierLoc, SourceLocation(), + RefQualifierIsLValueRef, RefQualifierLoc, + SourceLocation(), ESpecType, ESpecRange.getBegin(), DynamicExceptions.data(), DynamicExceptionRanges.data(), DynamicExceptions.size(), NoexceptExpr.isUsable() ? NoexceptExpr.get() : 0, ExceptionSpecTokens, None, - Loc, Loc, D, TrailingReturnType), std::move(FnAttrs), Loc); + Loc, Loc, D, TrailingReturnType, &FDS), std::move(FnAttrs), Loc); PrototypeScope.Exit(); Decl *TheDecl; @@ -820,9 +820,9 @@ SourceLocation Loc = Tok.getLocation(); Token Next,IITok; Next.setKind(Kind); - std::unique_ptr CCCValidator(new ExternalSpace::StatementFilterCCC(Next)); + ExternalSpace::StatementFilterCCC CCCValidator(Next); CXXScopeSpec SS; - Sema::NameClassification Classification = Actions.ClassifyName(getCurScope(), SS, II, Loc, Next, false, std::move(CCCValidator)); + Sema::NameClassification Classification = Actions.ClassifyName(getCurScope(), SS, II, Loc, Next, &CCCValidator); IITok.startToken(); IITok.setLocation(Loc); IITok.setIdentifierInfo(II); @@ -909,8 +909,8 @@ else if (T == DeclSpec::TST_typename) { Token Next,TypeTok; Next.setKind(tok::identifier); - std::unique_ptr CCCValidator(new ExternalSpace::StatementFilterCCC(Next)); - Sema::NameClassification Classification = Actions.ClassifyName(getCurScope(), SS, Name, Loc, Next, false, std::move(CCCValidator)); + ExternalSpace::StatementFilterCCC CCCValidator(Next); + Sema::NameClassification Classification = Actions.ClassifyName(getCurScope(), SS, Name, Loc, Next, &CCCValidator); TypeTok.startToken(); TypeTok.setLocation(Loc); TypeTok.setIdentifierInfo(Name);